Fork me on GitHub
#boot
<
2017-03-06
>
kommen15:03:02

I’m trying to set up boot-cljs-test with fixtures, i.e files containing test data and reference output, and then generate a test case for each file found in the fixtures diretory. however, I haven’t found a possibility to get those files into the test build. I tried adding them as a resource to the fileset, anything I’m overlooking?

micha15:03:55

@kommen how are you adding the files to the build?

micha15:03:18

can you paste the relevant part of your build.boot file please?

kommen15:03:08

@micha

(deftask backend-test
  (merge-env! :source-paths ["clj/backend/env/test" "clj/backend/src" "clj/backend/test"]
            :resource-paths ["clj/backend/fixtures"])
  (test-cljs :js-env :node :exit?  true))

micha15:03:50

looks like you're missing the arglist?

micha15:03:55

for the deftask

kommen15:03:45

I have that in my build.boot, it just got lost when cleaning up the snippet

kommen15:03:53

sorry about that

micha15:03:09

haha ok i thought it looked strange

micha15:03:05

that looks good to me

kommen15:03:20

as far as I can tell from https://github.com/crisptrutski/boot-cljs-test/blob/master/src/crisptrutski/boot_cljs_test.clj it looks like stuff like node_modules is copied manually into a temp dir

micha15:03:48

you're sure those files are not on the classpath during the tests?

micha15:03:06

because it looks like they should be

kommen16:03:45

@micha ok, looks I’m missing something here, as I just try to get the directory relative to the current working directory

micha16:03:18

ah, you want to get the files from the classpath, not the filesystem i think

kommen16:03:38

yeah, probably. thanks for the pointer

micha16:03:14

in general i think you want to use the classpath rather than the filesystem when you access things

micha16:03:30

that will provide a uniform interface for accessing files your program needs

micha16:03:54

basically a namespacing mechanism in the JVM for resources

micha16:03:32

then your code will work the same way if the file is in the filesystem or in a jar or even downloaded from a URL

kommen16:03:32

hmm, but i’m in cljs land, so my tests execute in a nodejs env, so I guess I’m out of the jvm land here

kommen16:03:23

I’m using https://github.com/pkpkpk/cljs-node-io for accessing the filesystem right now

phreed16:03:40

The leiningen repl colorizes and pretty-prints its output by default. How do I get this in a boot repl?

phreed16:03:27

When I start the repl 'boot repl' I get the following: SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details. nREPL server started on port 44977 on host 127.0.0.1 - <nrepl://127.0.0.1:44977> I added https://github.com/adzerk-oss/boot-logservice and now I get INFO boot.user - wow SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details. So, the logservice seems to be working but the SLF4J messages remain. How do I get rid of them?

micha16:03:06

i looked at the Puget and Whidbey projects but i couldn't really unwind the leiningen stuff it was doing

micha16:03:38

things need to be done in the nrepl middleware that i couldn't understand

micha16:03:17

that error means it can't find slf4j on the classpath (no slf4j dependency in your project)

micha16:03:03

the URL printed in the message will show you what you need to do to get rid of the message

mobileink17:03:22

has anybody managed to get boot-reload to reload html imports?

juhoteperi19:03:27

@mobileink What is html import?

gamecubate21:03:36

Hi all. How does one determine path of downloaded jars after “boot dev” has been invoked?

micha21:03:26

@gamecubate they will be in your local maven repo

micha21:03:38

default location is ~/.m2/repository/

gamecubate21:03:00

Yes thanks @micha Found it.

juhoteperi22:03:21

@mobileink Not supported currently

juhoteperi22:03:33

@mobileink I guess it would be possible to support that, currently Boot-reload will do page reload if the currently open html file is reloaded, but if the changed html file is different one, Boot-reload could check if there is import link to the file, similar how CSS reload works: https://github.com/adzerk-oss/boot-reload/blob/master/src/adzerk/boot_reload/reload.cljs#L63

mobileink20:03:31

juhoteperi: well, fyi my thing did start reloading the html, but it seems to reload the entire page, whereas what i would like is to just reload the imported bit. the bits being polymer components, fwiw. i'm not sure there's a way around this currently. once you register a webcomponent, there's no way to un/reload it - you get an "already registered" exception if you try.

richiardiandrea22:03:23

I wonder if Figwheel handles this

juhoteperi22:03:45

I'm pretty sure it doesn't. I don't think it looks at changed html files at all.

richiardiandrea22:03:58

If it does, for me it is quick to throw an event, but I haven't seen it