-
-
Notifications
You must be signed in to change notification settings - Fork 6.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
align circus with jasmine's top-to-bottom execution order #9965
Conversation
|
||
const {summary, rest} = extractSummary(stderr); | ||
expect(wrap(rest)).toMatchSnapshot(); | ||
expect(wrap(summary)).toMatchSnapshot(); | ||
expect(exitCode).toBe(0); |
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.
Nicer to see the snapshot diff rather than just the wrong number in case something goes wrong, so I changed this for all test cases in here
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.
yeah, good call. I've done that before as well for the same reason
@@ -28,12 +28,12 @@ export const makeDescribe = ( | |||
} | |||
|
|||
return { | |||
type: 'describeBlock', // eslint-disable-next-line sort-keys |
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.
disabling next line works out quite nicely for this rule, you can associate it with the line that you want to take out of the flow, because the error would be on the next line 😅
@@ -136,7 +136,9 @@ export const getEachHooksForTest = (test: Circus.TestEntry): TestHooks => { | |||
export const describeBlockHasTests = ( | |||
describe: Circus.DescribeBlock, | |||
): boolean => | |||
describe.tests.length > 0 || describe.children.some(describeBlockHasTests); | |||
describe.children.some( | |||
child => child.type === 'test' || describeBlockHasTests(child), |
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.
I love how the short-circuiting + union type narrowing works out here, so nice 😅
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.
Nice work @jeysal 👍
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.
Thanks! Somewhat scary refactor but it looks sane and all tests pass 👍
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
Fixes #8360
Test plan
Added a test to
globals.test
failing on circus master but passing on Jasmine and circus PR.