Skip to content
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

jest-circus: support globals #6283

Merged
merged 4 commits into from
May 26, 2018
Merged

Conversation

thymikee
Copy link
Collaborator

Summary

Part of #4362

Test plan

Globals are green

@@ -50,10 +50,8 @@ export const makeTest = (
parent: DescribeBlock,
timeout: ?number,
): TestEntry => {
let _mode;
if (!fn) {
_mode = 'skip'; // skip test if no fn passed
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We throw if fn is not defined

@@ -272,3 +270,31 @@ export const invariant = (condition: *, message: string) => {
throw new Error(message);
}
};

// See: https://github.com/facebook/jest/pull/5154
function convertDescriptorToString(descriptor) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hate this, but compat 🤷‍♂️

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a place we could put it in jest and share between both jasmine and circus?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could add this to jest-util, not sure if we want it though (requires another dep for circus)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • 1 dep > duplicated code 😛

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm fine with both though!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixd

@@ -272,3 +270,31 @@ export const invariant = (condition: *, message: string) => {
throw new Error(message);
}
};

// See: https://github.com/facebook/jest/pull/5154
function convertDescriptorToString(descriptor) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a place we could put it in jest and share between both jasmine and circus?

@@ -35,7 +35,7 @@ const handler: EventHandler = (event, state): void => {
}
case 'finish_describe_definition': {
const {currentDescribeBlock} = state;
invariant(currentDescribeBlock, `currentDescribeBlock mest to be there`);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:D

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure what i was even trying to say :)

@@ -32,7 +32,6 @@ exports[`cannot test with no implementation 1`] = `
4 | test('test, no implementation');
5 |

at packages/jest-jasmine2/build/jasmine/Env.js:<<LINE>>:<<COLUMN>>
at __tests__/only-constructs.test.js:<<LINE>>:<<COLUMN>>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pretty sure we don't need the LINE COLUMN stuff now that we have proper source maps. not relevant to this PR, though.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed anyway, thanks

@thymikee thymikee merged commit 87a1eb8 into jestjs:master May 26, 2018
@thymikee thymikee deleted the feat/circus/globals branch May 26, 2018 15:14
@github-actions
Copy link

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.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants