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

Investigate javascript + reactjs unit test framework #3084

Closed
jeff1evesque opened this issue Oct 24, 2017 · 8 comments
Closed

Investigate javascript + reactjs unit test framework #3084

jeff1evesque opened this issue Oct 24, 2017 · 8 comments

Comments

@jeff1evesque
Copy link
Owner

jeff1evesque commented Oct 24, 2017

We need to research possible frameworks, to unit test our javascript, and reactjs scripts. The following are some possible options, though other may be equally considered:

Note: this issue is intended to simply investigate viable options, and lead to further issues, for actual implementation, of the corresponding unit test method.

@ghost
Copy link

ghost commented Oct 24, 2017

Your issue doesn't follow our guidelines. Please fix the following:

  • Issue title must be in imperative, present tense (e.g. "add", "fix", "change") (?)

Click here for details.

Thank you! 🙏

This comment was made by GitMagic – Magically enforcing your contribution guidelines.

Repository owner deleted a comment Oct 24, 2017
Repository owner deleted a comment Oct 24, 2017
@jeff1evesque jeff1evesque changed the title Research javascript + reactjs unit testing framework Investigate javascript + reactjs unit test framework Oct 24, 2017
@ghost
Copy link

ghost commented Oct 24, 2017

Thank you, everything looks good now! :bowtie:

Repository owner deleted a comment Oct 24, 2017
@Vitao18
Copy link
Contributor

Vitao18 commented Oct 27, 2017

Some good links on this subject:
http://facebook.github.io/jest/docs/en/tutorial-react.html
https://www.testingexcellence.com/test-automation-tools-for-testing-reactjs-applications/

The second link states the best way to run unit tests in React is Mocha+Enzyme.
From what I've read, Enzyme makes the testing syntax easy and is the way to go.
Jest is kinda of slow and have confusing Mock, but requires the least configuration.

I like the almost-no-configuration approach(Jest)

@jeff1evesque
Copy link
Owner Author

I like jest, since it seems to be able to unit test both reactjs, and vanilla javascript. Could you find out how to integrate jest tests with travis ci. From quick skimming around, it seems istanbul is built into jest. What we'll need to find out, is how to integrate jest + istanbul into coverage reports for travis ci.

@jeff1evesque
Copy link
Owner Author

jeff1evesque commented Oct 28, 2017

I think in order to have multiple unit tests, we would have to converge all reports into a single .coverage/results.json. This would be related to the badge on the README.md, which shows how much of our code is covered under unit tests. This is something I enjoy enough doing. So, maybe you can investigate the necessary syntax, using a tool, which could appropriately generate a results.json.

Note: the badge associated with build|failing, or build|passing, that's something I could do easily.

@Vitao18
Copy link
Contributor

Vitao18 commented Oct 28, 2017

Good!
I'll start learning how to test using Travis CI with the Jest+Enzyme also learning how to test!
I'm gonna let you know of what I find in the way

@jeff1evesque
Copy link
Owner Author

jeff1evesque commented Oct 28, 2017

Don't worry so much about the Travis initially. If you must, make sure whatever tool you use is compatible with a tool like coveralls. Jest should have a thing called Istanbul, which should play nice with coveralls. If that's the case, I can connect the report output from .coverage/results.json to the Travis CI. I'm not sure about Enzyme.

@jeff1evesque
Copy link
Owner Author

Closing this issue, since work will now be done in #3087.

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

No branches or pull requests

2 participants