Hi !
I’m an elm beginner, and I need to pull some data from sessionStorage
to use this data in my http
queries. As far as I understood, I need to go native to do it. Here is the current state of my beginner’s quest to get it working.
I found a package for doing it ( https://github.com/gdotdesign/elm-storage ), that also provides helpers for tests. Great !
Okay, let’s start: first, it is not managed by the package manager, because it embed native code. Okay, it is a choice as a community I can understand, but how do people make elm program using the sessionStorage ?
They seem to either embed it in their own programs directly ( copy/paste ?), or make use of third party packages not hosted by the main repository, and use, for example, https://github.com/gdotdesign/elm-github-install , aka elm-install
to install those.
I run the elm-install, it works properly, so now, I can write my code. I write it, making usage of the library after a proper install, it compiles
Now I’d like to check it in unit tests. I go to my tests, add a new one, run elm-test
as usual, and well it does not find my third party dep.
Okay, so let’s try:
- searching on the internet for
elm-install
andelm-test
: nothing that really matches - adding it directly in my tests
elm-package.json
: does not work - try
elm-install
before from thetests
directory: doesn’t work - try copying
/elm-stuff
from root totests
: doesn’t work - try using
elm-test --add-dependencies
: doesn’t work
I cannot find module 'Storage.Spec.Session'.
Module 'AuthSpec' is trying to import it.
Potential problems could be:
* Misspelled the module name
* Need to add a source directory or new dependency to elm-package.json
I feel like I’ve used most of the solutions that jumps at me, and finding nothing related makes me think I do something wrong, what is it ?
How do you handle testing third party modules ? Should I find another test runner ( I found a elm-install-test, but it’s a placeholder ) ? How do you deal with that yourself ?