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 mocha as a test runner #50

Merged
merged 1 commit into from
Mar 11, 2020
Merged

Add mocha as a test runner #50

merged 1 commit into from
Mar 11, 2020

Conversation

scottyantipa
Copy link
Contributor

@scottyantipa scottyantipa commented Mar 10, 2020

Setup mocha as a test runner and wrote some initial tests. This implements the same test suite as #49 which uses jest. This doesn't change the dist, and currently you need to manually invoke npm test (eg. no CI setup, and it doesn't run before a publish).

This PR adds:

  • npm run test and npm run test -- --watch, npm run test:cover
  • New libs: enzyme (react tests), jsdom (mock DOM), chai (assertions), and sinon (mocks)
  • A new .nvmrc to pin a node version (v10 required for some of the test utils)
  • Tests that get us up to about 70% coverage, still pretty minimal

So far the noticeable differences:

  • jest is way easier to setup, batteries included
  • mocha appears significantly faster, especially for --watch
  • both offer similar functionality

Fix #51 see the issue for for more details on mocha vs jest

@scottyantipa scottyantipa added the WIP work in progress label Mar 10, 2020
@scottyantipa scottyantipa mentioned this pull request Mar 10, 2020
@scottyantipa scottyantipa removed the WIP work in progress label Mar 10, 2020
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.

Add a test suite
1 participant