-
Notifications
You must be signed in to change notification settings - Fork 37
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
Replace bash test to TS using shelljs #251
Conversation
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.
No need to directly use shelljs for something that's natively supported in node.js (cp, rm, mv, potentially others)
Also, when a check.ts
file is introduced, the corresponding check.sh
can be deleted. I think it would be easier to review if both were visible at the same time in the Files changed part of the PR.
test/configuration-tests/with-account-compilation-option/check.ts
Outdated
Show resolved
Hide resolved
test/configuration-tests/with-account-compilation-option/check.ts
Outdated
Show resolved
Hide resolved
- Use console.log in place of shell.echo - use fs functions to copy, delete and read file
- Use spawn to detach bg process - add --no-compile flag
How much trouble would it be to also convert test.sh to e.g. TS? Doesn't have to be done in this PR, just asking for a future improvement. |
test/configuration-tests/with-account-compilation-option/check.ts
Outdated
Show resolved
Hide resolved
- Remove shell.exit, shell.echo - Use axios inplace of curl - Update contains function
I'd say not much trouble. It can be handled in a similar fashion like what this PR achieves. |
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.
Some conversations were resolved (even though no commit link was provided) so I marked them as resolved. But some I left unresolved since they don't look addressed to me.
StarknetPluginError
in tests should be replaced with some kind of assertion error (it can be explicitly thrown, or implicitly - through e.g. chai expectations).
|
- Use assertContains - Throw AssertionError
Usage related changes
check.sh
shell scripts to TS using ShelljsDevelopment related changes
test_case/check.sh
have been removed and insteadtest_case/check.ts
will be used.npx mocha
Checklist:
test
directory (with a test case consisting ofnetwork.json
,hardhat.config.ts
,check.sh
)