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 a test suite #51

Closed
scottyantipa opened this issue Mar 10, 2020 · 3 comments · Fixed by #50
Closed

Add a test suite #51

scottyantipa opened this issue Mar 10, 2020 · 3 comments · Fixed by #50

Comments

@scottyantipa
Copy link
Contributor

scottyantipa commented Mar 10, 2020

Experimenting with different test runners in these PRs:

Honorary mention to https://github.com/avajs/ava for simplicity and Magic Diffs

@scottyantipa
Copy link
Contributor Author

Unfortunately I haven't found a way around Jest being quite slow, especially for a small number of tests.

Some existing issues about slowness which are still open, and stale:

These are the stats I got for the small test suite implemented in #49 and #50

|Speed comparison
|Mocha:
|- test:cover in 4.3s (also checking too many files)
|- test in 2.1s
|- --watch feels instantaneous
|Jest:
|- test:cover in 4.8s
|- test in 4.6s
|- --watch is far from instantaneous. Takes at least 2s.

@scottyantipa
Copy link
Contributor Author

Some visual comparison on test outputs. I'd say they're about the same, although jest has a nicer way of displaying the failed source line clearly.

Obj diffs:
Jest:
jest-obj-diff
Mocha
mocha-obj-diff
and AVA for fun:
ava-obj-diff

Test failure output
Jest:
jest-test-failure
Mocha
mocha-test-failure

@scottyantipa
Copy link
Contributor Author

One very nice feature of jest that mocha lacks is that it will only re-run tests that have changed in the current commit while in --watch mode. Whereas mocha will seemingly re-run the entire test suite, which could get slow.

mocha-reruns-all-on-watch

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 a pull request may close this issue.

1 participant