Skip to content

Migrate tests to jest #203

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

Merged
merged 2 commits into from
Jul 16, 2018
Merged

Migrate tests to jest #203

merged 2 commits into from
Jul 16, 2018

Conversation

nason
Copy link
Collaborator

@nason nason commented Jul 15, 2018

This is a rather large PR but I refactored the tests to use jest, and in doing so:

  • removed the dependency on nock in tests
  • organized tests into separate files, co-located with source
  • leveraged snapshot testing heavily
  • removed ~600 lines of test code
  • abstracted away some repetitiveness to make it easier to add test cases
  • in addition to src, run against es build (TODO figure out running against lib build too)

@coveralls
Copy link

coveralls commented Jul 15, 2018

Coverage Status

Coverage remained the same at 100.0% when pulling 4532813 on test-w-jest into 1ed4ab0 on next.

@nason nason added this to the 3.0.0 milestone Jul 15, 2018
@nason nason merged commit c424041 into next Jul 16, 2018

exports[`#apiMiddleware must dispatch a success FSA with an error state on a successful API call with an invalid JSON response: final result 1`] = `
Object {
"error": true,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated -- but I want to note that there are still a few situations in which REQUEST and SUCCESS type actions dispatch with an error flag

I think a follow up to #175 is in order

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.

2 participants