Skip to content
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

ADD: Testing documentation #513

Merged
merged 1 commit into from
Jan 7, 2020
Merged

ADD: Testing documentation #513

merged 1 commit into from
Jan 7, 2020

Conversation

VladimirMikulic
Copy link
Contributor

@VladimirMikulic VladimirMikulic commented Jan 7, 2020

Testing is described in a new TESTING.md file.
I've also added grunt test to the test NPM script.

Resolves #506

@cesswairimu could you take a look at this? Thanks.

Testing is described in a new TESTING.md file.

Resolves #506
@jywarren
Copy link
Member

jywarren commented Jan 7, 2020

This is really lovely. Wonderful work! cc @sashadev-sky @rexagod 🎉 💯

@jywarren jywarren merged commit 37f8cd6 into publiclab:main Jan 7, 2020
@jywarren
Copy link
Member

jywarren commented Jan 7, 2020

Oh sorry @cesswairimu i just got excited!

cc @crisner @sagarpreet-chadha this is such a good documentation section on testing. take a look! 👀

@VladimirMikulic
Copy link
Contributor Author

Thank you very much @jywarren!

@crisner
Copy link

crisner commented Jan 8, 2020

This is great! Love the documentation. Amazing work @VladimirMikulic!

@VladimirMikulic
Copy link
Contributor Author

Thanks @crisner.

@cesswairimu
Copy link
Collaborator

Amazing 🚀

@VladimirMikulic
Copy link
Contributor Author

I appreciate it @cesswairimu.

@sashadev-sky
Copy link
Member

Just checked this out thank you so much!! @VladimirMikulic

$ mocha <filename>.js doesn't work for me even after installing it globally. It doesn't recognize L (leaflet) as a context and after I managed to get that working by passing in some extra options it doesn't recognize chai from the specHelper.js file. Any clue what I'm missing?

@VladimirMikulic
Copy link
Contributor Author

@sashadev-sky my mistake. I've noticed that we don't manually require modules in our tests.
In order for this to work, we should require chai in the test files, the same goes for L and other modules(browser's window object also).

That's one way of doing it. The other one is to wrap the code of the test file in one describe.only() block and then run npm test which will run only that test file.

How should I update this? Thanks.

@sashadev-sky
Copy link
Member

@VladimirMikulic no problem! not a big deal. I'm not sure we can use require outside of the Gruntfile could be wrong? If we can't fix it the 1st way we can just update the readme to say the 2nd one! Thank you!

@VladimirMikulic
Copy link
Contributor Author

@sashadev-sky we can use require outside of Gruntfile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enhance testing documentation
5 participants