-
Notifications
You must be signed in to change notification settings - Fork 157
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
deps(testing) - consolidate testing frameworks across the project #819
Changes from 7 commits
399ac31
259c14b
1329572
e14bebe
8a14264
f2a8abf
e576c84
f44ff8e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -108,17 +108,26 @@ own unit tests. | |
|
||
### Unit tests | ||
|
||
Unit tests within the project are built using [Mocha](https://mochajs.org/) and [Chai](https://www.chaijs.com/). Mocha is a test framework that provides the environment to write and run JavaScript tests, while Chai is an assertion library that allows us to write assertions in a more expressive and readable way. | ||
|
||
|
||
The following submodules contain unit tests: `core`, `crypto`, `circuits`, | ||
`contracts`, and `domainobjs`. | ||
|
||
Except for the `contracts` submodule, run unit tests as such (the following | ||
samajammin marked this conversation as resolved.
Show resolved
Hide resolved
|
||
example is for `crypto`): | ||
You can run all unit tests from the root directory of the repo by running: | ||
|
||
```bash | ||
npm run test | ||
``` | ||
|
||
Our you can run unit tests within each submodule. for example to run the `crypto` tests: | ||
|
||
```bash | ||
cd crypto | ||
npm run test | ||
``` | ||
|
||
<!-- TODO: confirm if true --> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ctrlc03 is this necessary? Seems I'm able to run the full suite e.g. of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Is this needed? I'm able to just run There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yea that's how it's supposed to work (hardhat does start itself) so yea feel free to remove. In general most of these README are outdated (wondering if it might better to address all in one PR?) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I'm alright with that, though generally I think best to update documentation at the same time as the code is updated (ideally in the same PR), because:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Noted! I'll make sure from now on all doc updates are included in the PR 🙂 |
||
For `contracts` and `integrationTests`, run the tests one by one. This prevents | ||
incorrect nonce errors. | ||
|
||
|
@@ -136,12 +145,11 @@ cd contracts | |
npm run test | ||
``` | ||
|
||
Or run tests individual as such: | ||
Or run individual tests: | ||
|
||
```bash | ||
cd contracts | ||
npm run test-accQueue | ||
npx jest AccQueue | ||
``` | ||
|
||
Where both test commands run `AccQueue.test.ts` | ||
|
This file was deleted.
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.
What's this change about?
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.
Oh yea sorry for not mentioning in the description! Basically this change is so that the e2e test only run when the actual circom files change, not any files in the circuits folder as it was until this commit. I was planning to introduce this with another PR but got carried away by not wanting to wait on circuits compilation for this PR
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.
Awesome. Great catch.