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 AVA test runner integration #1022
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov Report
@@ Coverage Diff @@
## main #1022 +/- ##
==========================================
+ Coverage 93.32% 93.50% +0.17%
==========================================
Files 95 94 -1
Lines 9901 9882 -19
Branches 937 936 -1
==========================================
Hits 9240 9240
+ Misses 661 642 -19
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
david0xd
force-pushed
the
dd/ava-integration
branch
4 times, most recently
from
December 5, 2022 15:56
b416ce1
to
695b1d0
Compare
Mrtenz
reviewed
Dec 6, 2022
packages/snaps-execution-environments/src/common/endowments/timeout.ava.test.ts
Outdated
Show resolved
Hide resolved
david0xd
force-pushed
the
dd/ava-integration
branch
from
December 6, 2022 14:31
a2f9077
to
6d7dfb0
Compare
hmalik88
previously approved these changes
Dec 6, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
david0xd
force-pushed
the
dd/ava-integration
branch
from
December 7, 2022 10:56
06c1704
to
5c1d834
Compare
Add some test refactoring Revert jest.environment.js change Fix ts-comment in test Add coverage merge process Fix build issues Fix test snapshot errors Fix broken test in snaps-utils Fix problematic test snapshot Fix dependencies after rebase Try to fix problematic snapshots in rollback Update test snapshot for webpack plugin (root test run) Try to fix test snapshot on another platform (Ubuntu) Fix snapshot
david0xd
force-pushed
the
dd/ava-integration
branch
from
December 7, 2022 13:33
5c1d834
to
db42d3f
Compare
hmalik88
approved these changes
Dec 7, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR will add tools and configurations which will provide a new way of unit testing using AVA test runner which is primarily added because of testing SES functionalities.
Fixes: #1016
PR summary
Added packages
ava
- AVA test runner.@ava/typescript
- TypeScript support for AVA test runner.c8
- Test coverage reporter recommended for AVA, using v8.mkdirp
- Cross platformmkdir
. Used to merge and regenerate coverage report.nyc
- Used to merge and regenerate coverage report.shx
- Cross platform solution forcp
used when copying files is needed to merge coverage report.Added yarn scripts
test:ava
- This will run only AVA tests. This script is used in the maintest
script. It can be useful when working only on AVA tests or testing security (SES) related parts of code.merge:coverage
- This command will execute several scripts in order to merge coverage report and clean working directory from all temporary files and folders used in the process.Modified yarn scripts
test
- This script is now modified to run AVA first, then continue with usual Jest testing workflow. It is required for AVA to run first because Jest exits the process after it finishes with errors. After successful run,merge:coverage
command is added to the end of this script.Added configurations
New configuration file is added for the AVA tests -
ava.config.js
.There is also a new file for configuring coverage test reporter for
c8
-.c8rc.json
.AVA and Jest configurations are added/modified in order to run two separate group of tests in two independent runs of both test runners. AVA tests needs to have
.ava.test.ts
suffix and will be automatically picked up by the AVA test runner. Test with suffix.ava.test.ts
will be ignored by Jest and excluded from coverage as well.Additional notes
timeout.ava.test.ts
file is added with single test that is testing small part of security. This is required because AVA test runner requires at least one test (file) in order to work properly with the configuration and yarn scripts.Coverage report for AVA tests is generated under
coverage-ava
directory. This is temporary directory which is deleted in the coverage merge process. After both test runners have finished, coverage reports will be merged together and can be browser under regularcoverage
directory as usual.No SES functionalities or configurations are added in this PR, as this is only to support future testing of it.