-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error running tests #10
Comments
My guess is that you are testing with phantom.js or something like it. These testing tools do not support things like local-storage. You'd need a browser for that. |
@Frozenlock you are correct on both the assumption that I was using Phantom and that attempting to access localStorage in Phantom does seem to cause an issue. How do the tests for this library work given that they run with Phantom? What did you end up using other than Phantom, and do you perhaps have an example of wiring something else up for tests with reagent? |
While not the most elegant, I mostly use the same technique as the one used for the Reagent projects. See this example: https://github.com/reagent-project/reagent-cursor/tree/master/test |
@Frozenlock wanted to let you know that the issue was not with Phantom but with clojurescript.test see this issue for reference. It has been fixed in version 0.3.3 after an update tests ran as expected with Phantom. |
Nice, thanks for the heads up! |
I am unable to successfully include the storage-atom library in my reagent project. When the
local-storage
function is in the application I receive the following error when attempting to run the tests.This can be recreated by creating a reagent project from the template
lein new reagent local-storage-error +test
The tests can be run successfuly at this point.
lein cljsbuild test
Add the storage-atom lib to the project and include it in
core.cljs
and create the def from the readme(def prefs (local-storage (atom {}) :prefs))
Now attempting to run the tests again will produce the error from above.
The text was updated successfully, but these errors were encountered: