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

chore: update how we track coverage during unit tests #5779

Merged
merged 4 commits into from Apr 30, 2020

Commits on Apr 30, 2020

  1. chore: update how we track coverage during unit tests

    The old method of tracking coverage was causing issues. If a test failed
    on CI, that test's failure would be lost because the test failing would
    in turn cause the coverage to fail, but the `process.exit(1)` in the
    coverage code caused Mocha to not output anything useful.
    
    Instead the coverage checker now:
    
    * tracks the coverage in memory in a Map (this hasn't changed)
    * after all tests, writes that to disk in test/coverage.json (which is
    gitignored)
    * we then run a single Mocha test that asserts every method was called.
    
    This means if the test run fails, the build will fail and give the error
    about that test run, and that output won't be lost when the coverage
    then fails too.
    jackfranklin committed Apr 30, 2020
    Copy the full SHA
    fb48d2c View commit details
    Browse the repository at this point in the history
  2. lint fix

    jackfranklin committed Apr 30, 2020
    Copy the full SHA
    76889fd View commit details
    Browse the repository at this point in the history
  3. Copy the full SHA
    a22dfe8 View commit details
    Browse the repository at this point in the history
  4. Update test/assert-coverage-test.js

    Co-Authored-By: Mathias Bynens <mathias@qiwi.be>
    jackfranklin and mathiasbynens committed Apr 30, 2020
    Copy the full SHA
    dda3439 View commit details
    Browse the repository at this point in the history