Skip to content

port script tests from mocha to jest#6517

Merged
shiftkey merged 9 commits intodevelopmentfrom
port-script-tests-to-jest
Jan 16, 2019
Merged

port script tests from mocha to jest#6517
shiftkey merged 9 commits intodevelopmentfrom
port-script-tests-to-jest

Conversation

@shiftkey
Copy link
Member

@shiftkey shiftkey commented Dec 31, 2018

Overview

I'd like us to move away from mocha and chai usage in favour of plain jest and jest plugins now that we have the unit test suite working nicely. This PR is another step on that journey.

Description

To avoid confusion I moved the root jest.config.js under app to move it closer to code it's associated with testing. I then added a script/jest.config.js that is associated with testing the scripting functionality. Like before, I also replaced the chai assertions with the jest builtins.

  • jest-junit now needs to emit distinct test runs to upload to Azure Pipelines (by default it'll overwrite junit.xml)

Release notes

Notes: no-notes

@shiftkey shiftkey added ready-for-review Pull Requests that are ready to be reviewed by the maintainers infrastructure Issues and pull requests related to scripts and tooling for GitHub Desktop and removed ready-for-review Pull Requests that are ready to be reviewed by the maintainers labels Dec 31, 2018
@shiftkey shiftkey force-pushed the port-script-tests-to-jest branch from deb2ae4 to f6f3c9e Compare December 31, 2018 18:56
@shiftkey
Copy link
Member Author

As a sanity check, I confirmed the test counts and code coverage still match between development and this PR:

development branch

$ yarn test:unit:cov

...

=============================== Coverage summary ===============================
Statements   : 29.59% ( 5182/17514 )
Branches     : 14.99% ( 1253/8359 )
Functions    : 16.17% ( 592/3661 )
Lines        : 29.77% ( 5148/17292 )
================================================================================

Test Suites: 80 passed, 80 total
Tests:       2 skipped, 662 passed, 664 total
Snapshots:   0 total
Time:        23.294s
✨  Done in 24.80s.

This PR (as of f6f3c9e)

$ yarn test:unit:cov

...


=============================== Coverage summary ===============================
Statements   : 29.59% ( 5182/17514 )
Branches     : 14.99% ( 1253/8359 )
Functions    : 16.17% ( 592/3661 )
Lines        : 29.77% ( 5148/17292 )
================================================================================

Test Suites: 80 passed, 80 total
Tests:       2 skipped, 662 passed, 664 total
Snapshots:   0 total
Time:        22.781s, estimated 36s
✨  Done in 24.10s.

@shiftkey shiftkey added the ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Dec 31, 2018
@shiftkey shiftkey mentioned this pull request Dec 31, 2018
2 tasks
@shiftkey shiftkey added ready-for-review Pull Requests that are ready to be reviewed by the maintainers and removed ready-for-review Pull Requests that are ready to be reviewed by the maintainers labels Jan 2, 2019
@shiftkey shiftkey force-pushed the port-script-tests-to-jest branch from bb517ad to 723307a Compare January 3, 2019 13:39
@shiftkey shiftkey force-pushed the port-script-tests-to-jest branch from 723307a to 7f59333 Compare January 3, 2019 17:08
@shiftkey shiftkey added this to the 1.6.1 milestone Jan 8, 2019
@iAmWillShepherd iAmWillShepherd self-assigned this Jan 10, 2019
@shiftkey shiftkey merged commit 1b93fd4 into development Jan 16, 2019
@shiftkey shiftkey deleted the port-script-tests-to-jest branch January 16, 2019 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

infrastructure Issues and pull requests related to scripts and tooling for GitHub Desktop ready-for-review Pull Requests that are ready to be reviewed by the maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants