-
Notifications
You must be signed in to change notification settings - Fork 115
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
Refactor e2e tests to use Sandbox #651
Conversation
@anton-trunov Here's a draft of the refactor. You can look how Another option would be to make some |
@Gusarich So do I understand correctly
|
no it doesn't. tracker just parses a bunch of transactions from Sandbox into readable and clean format that was used in tact emulator |
We could do that, but I don't think having lots of unused info is really beneficial for tests.
It just creates large diffs that nobody reads. Instead of that I'd prefer to have tests like the ones in the Blueprint template for the counter contract: https://github.com/ton-org/blueprint/blob/9b1c238938047d3ca1a1b30e5706fcb759950025/src/templates/tact/counter/tests/spec.ts.template |
this one is an external message to treasury that initiates everything else. we can just hide that. but everything else should be parsed into readable format |
so you suggest moving from snapshot-based testing to explicit checks like This way we won't even need Tracker and that new |
I'd say we don't even need to have |
well, it depends on the case. |
I like the idea! We can generate it for |
… `increment.spec.ts`
8b7063b
to
2486c1d
Compare
@anton-trunov @novusnota I've pushed refactors of several tests. I'd like to hear your opinion and (maybe) change something in the way I do these before going further. |
It seems to me now that we probably won't even need self-getters for most of the e2e tests because the things that are being tested usually have their own getters. |
@Gusarich Looks incredible! We could probably implement some helpers to reduce boilerplate for the frequent case where you send a message and then immediately check it was successful: For instance, this
should probably by refactored into one such helper call |
@anton-trunov each contract has different available message types and it will be problematic to somehow generalize such |
@anton-trunov I agree with @Gusarich here, as I've tried implementing the same idea and it turned out to be a very leaky abstraction in the end |
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!
@anton-trunov I think we can also safely remove stuff such as |
We can certainly try |
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! We indeed could try to remove @tact-lang/ton-abi
, but the @tact-lang/ton-jest
is used for snapshotSerializers
in jest.config.json
and without @tact-lang/coverage
we'll need to re-make jest.setup.js
and jest.teardown.js
Closes #510
I have documented my contribution in Tact Docs: https://github.com/tact-lang/tact-docs/pull/PR-NUMBER