-
-
Notifications
You must be signed in to change notification settings - Fork 31
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
[tests] Add unit tests to existing codebase #181
Conversation
Signed-off-by: Stefan Friedle <[email protected]>
Signed-off-by: Stefan Friedle <[email protected]>
Signed-off-by: Stefan Friedle <[email protected]>
Signed-off-by: Stefan Friedle <[email protected]>
Signed-off-by: Stefan Friedle <[email protected]>
Signed-off-by: Stefan Friedle <[email protected]>
Signed-off-by: Stefan Friedle <[email protected]>
Signed-off-by: Stefan Friedle <[email protected]>
Signed-off-by: Stefan Friedle <[email protected]>
The Jest mock functions and spies are now closer to their callers. java.mock.js is now independent of Jest. Signed-off-by: Stefan Friedle <[email protected]>
Signed-off-by: Stefan Friedle <[email protected]>
Signed-off-by: Stefan Friedle <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Honestly, I‘ve no experience with jest, but reading through the tests, I think I understand it.
So, as fas as I can say: LGTM, thanks!
Please have a look at my minor comments.
Please do not force push from now on!!
Signed-off-by: Stefan Friedle <[email protected]>
Signed-off-by: Stefan Friedle <[email protected]>
@florian-h05 Shall we merge and close this pull request? The contained tests cover nearly all JavaScript files in the root directory. I can open new pull requests when I continue to write tests for the remaining files in subdirectories, like |
I‘ll have a final look later, but I am very happy with merging this first PR! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for your contribution!
Relates to #166. * Add Jest dependencies and configuration. * Add tests for utils.js. * Add tests for triggers.js. * Add tests for cache.js. * Refactor mocking of global Java types. * Ignore .DS_Store. * Reorganize npm test scripts. * Move Jest mock functions. The Jest mock functions and spies are now closer to their callers. java.mock.js is now independent of Jest. * Add tests for osgi.js. * Add tests for actions.js. Signed-off-by: Stefan Friedle <[email protected]>
Relates to #166
Description
This PR adds unit tests to the existing codebase. Until now there are only two unit tests, written with Mocha. The newly added tests use Jest as testing framework. To distinguish between the Mocha and Jest tests, we use this filename pattern:
*.test.js
*.spec.js
The tests can be run with this commands:
npm run test
runs all tests and lints the sources.npm run test:mocha
runs the existing Mocha tests.npm run test:jest
runs the new Jest tests.