-
Notifications
You must be signed in to change notification settings - Fork 18
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
UX Improvements #273
Merged
Merged
UX Improvements #273
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
…Instance that holds the wasm path
dimitrovmaksim
force-pushed
the
test_ux_improvements
branch
from
January 21, 2022 13:27
21bbe07
to
01ce556
Compare
georg-getz
reviewed
May 27, 2022
georg-getz
reviewed
Jun 2, 2022
src/test_suite.rs
Outdated
} | ||
} | ||
|
||
// A recursive fucntion that builds the the test suite from a single test.ts file. |
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.
fucn
georg-getz
reviewed
Jun 2, 2022
src/test_suite.rs
Outdated
|
||
// In order to get all functions inside a describe() block, we need to create a clone | ||
// of the current MatchstickInstance, then fetch and execute the said describe() function by it's id | ||
// from the context of the cloned instance. This will trigger the reigstration of all the functions |
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.
reig
georg-getz
approved these changes
Jun 2, 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.
Issues:
closes #119
closes #310
Depends on:
LimeChain/matchstick-as#43
What it does:
beforeAll
andafterAll
functionsbeforeEach
andafterEach
functionsdescribe
with support for nested describestest.ts
file will be compiled into a separate test suite, even if multiple test files are grouped into a folder, e.g:will yield two test suites named
gravity/create
andgravity/update
Basic Structure:
describe(name: String , () => {})
- Defines an example/test group.Notes:
Example:
Nested
describe()
example:test(name: String, () =>, should_fail: bool)
- Defines an example/test case. You can use test() inside describe() blocks or independently.Example:
beforeAll(() => {})
- Runs a code block before any of the tests in the file. If beforeAll is inside a describe block, it runs at the beginning of the describe block.Examples:
Code inside
beforeAll
will execute once before all describe blocksCode inside
beforeAll
will execute once before all tests in the first describe blockafterAll(() => {})
- Runs a code block after all of the tests in the file. If afterAll is inside a describe block, it runs at the end of the describe block.Example:
Code inside
afterAll
will execute once after all describe blocksCode inside
afterAll
will execute once after all tests in the first describe blockbeforeEach(() => {})
- Runs a code block before every test. If beforeEach is inside a describe block, it runs before each test in that describe.Examples:
Code inside
beforeEach
will execute before each tests.Code inside
beforeEach
will execute before each test in the first describeafterEach(() => {})
- Runs a code block after every test. If afterEach is inside a describe block, it runs after each test in that describe.Examples:
Code inside
afterEach
will execute after every test.Code inside
afterEach
will execute after each test in the first describeHow To Test:
There is a beta release if you want to try it out, but you'll need a couple of things before that:
0.5.0
. You can do that either by providing the-v
flag to thegraph test
commandgraph test -v 0.5.0
, or you can download the binary for your OS, to your subgraph folder, change the permissions withchmod a+x
and then run the binary from the terminal, for example./binary-macos-11
That should be all!
If you encounter any bug or issues, or have any questions, feel free to leave a comment.