-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
chore: implement additional test cases for the node test reporter (part 2) #5692
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
@@ -0,0 +1 @@ | |||
throw new Error("error"); |
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.
Note for a future pr: we need to change the output generated in this case, as it has nothing to do with promises.
...t/hardhat-node-test-reporter/integration-tests/fixture-tests/only-test-with-the-flag/test.ts
Show resolved
Hide resolved
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.
Looks good! I like that options idea.
I just left a comment about one test.
fb775b7
to
97f7d56
Compare
I also added a test case for an unawaited It does seem to work just fine, though. |
I think we need to force it to go through the event loop. I somehow was getting this error, that's why I added an error message related to promises when you throw from the top-level 😅 I think we can merge this and tackle that on a follow up pr when fixing that error message. |
This is a follow-up to #5669 and it is related to #5437
This PR covers adding more test cases that we chatted about. I'll be proposing changes to the reporter's output in a separate PR(s).
Newly added test cases:
describe.only
andit.only
executed without the--test-only
flagtest.only
,describe.only
andit.only
executed with the--test-only
flagit
stest.todo
without a callbackThe IT frameworks improvements that support the newly added test cases:
RunOptions
per fixture test - This was needed to be able to testtest.only
with the--test-only
flag enabled. If one puts aoptions.json
file inside the fixture test, it is going to be parsed by both the IT test runner, as well as our script that regenerates the fixtures.result.actual.txt
inside the fixture test and I gitignore these files because they do not need to be checked in.at async node:...
- We missed that flavour of node internal traces before.Node.js
- This, currently, only affects the test case where we throw an error at the top level of the test file. In such a case, the output first lists the error details, then prints the node version and then continues to print the output from the reporter. I decided to propose removing that output from the checked-in results instead of just skipping it during normalization because we do not have control over that part in the reporter.