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 helper function for writing parameterized JS tests #3224

Merged
merged 1 commit into from
Apr 19, 2016

Conversation

robertknight
Copy link
Member

Mocha lacks built-in support [1] for writing parameterized tests and the
suggested solution [2] involves a bunch of boilerplate which has IMO
resulted in different styles of parameterized tests in our codebase and
not having parameterized tests when they would be useful to attain more
complete coverage.

This adds a helper inspired by [3] for writing parameterized tests and
switches several existing places in our code to use it.

[1] mochajs/mocha#1454
[2] https://mochajs.org/#dynamically-generating-tests
[3] https://github.com/lawrencec/Unroll

Mocha lacks built-in support [1] for writing parameterized tests and the
suggested solution [2] involves a bunch of boilerplate* which has IMO
resulted in different styles of parameterized tests in our codebase and
not having parameterized tests when they would be useful to attain more
complete coverage.

This adds a helper inspired by [3] for writing parameterized tests and
switches several existing places in our code to use it.

* Though less with ES2015 syntax.

[1] mochajs/mocha#1454
[2] https://mochajs.org/#dynamically-generating-tests
[3] https://github.com/lawrencec/Unroll
@codecov-io
Copy link

Current coverage is 74.03%

Merging #3224 into master will not affect coverage as of a436fbc

@@            master   #3224   diff @@
======================================
  Files          126     126       
  Stmts         4680    4680       
  Branches       555     555       
  Methods          0       0       
======================================
  Hit           3465    3465       
  Partial         83      83       
  Missed        1132    1132       

Review entire Coverage Diff as of a436fbc

Powered by Codecov. Updated on successful CI builds.

@chdorner
Copy link
Contributor

Nice and simple solution! LGTM.

@chdorner chdorner merged commit df6817d into master Apr 19, 2016
@chdorner chdorner deleted the parameterized-frontend-tests branch April 19, 2016 11:44
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.

3 participants