-
Notifications
You must be signed in to change notification settings - Fork 31
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
feat: Add support for jest@27 #123
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,77 +1,15 @@ | ||
{ | ||
"extends": "eslint:recommended", | ||
"parser": "babel-eslint", | ||
"parser": "@babel/eslint-parser", | ||
"parserOptions": { | ||
"ecmaVersion": 9, | ||
"sourceType": "module" | ||
"sourceType": "module", | ||
"requireConfigFile": false | ||
}, | ||
"env": { | ||
"es6": true, | ||
"browser": true, | ||
"jest": true, | ||
"node": true | ||
}, | ||
"rules": { | ||
"block-scoped-var": "error", | ||
"no-alert": "warn", | ||
"no-buffer-constructor": "error", | ||
"no-eval": "error", | ||
"no-extra-bind": "error", | ||
"no-extra-label": "error", | ||
"no-iterator": "error", | ||
"no-lone-blocks": "error", | ||
"no-proto": "error", | ||
"no-new-require": "error", | ||
"no-restricted-properties": ["error", { | ||
"object": "arguments", | ||
"property": "callee", | ||
"message": "arguments.callee is deprecated" | ||
}, { | ||
"object": "global", | ||
"property": "isFinite", | ||
"message": "Please use Number.isFinite instead" | ||
}, { | ||
"object": "self", | ||
"property": "isFinite", | ||
"message": "Please use Number.isFinite instead" | ||
}, { | ||
"object": "window", | ||
"property": "isFinite", | ||
"message": "Please use Number.isFinite instead" | ||
}, { | ||
"object": "global", | ||
"property": "isNaN", | ||
"message": "Please use Number.isNaN instead" | ||
}, { | ||
"object": "self", | ||
"property": "isNaN", | ||
"message": "Please use Number.isNaN instead" | ||
}, { | ||
"object": "window", | ||
"property": "isNaN", | ||
"message": "Please use Number.isNaN instead" | ||
}, { | ||
"property": "__defineGetter__", | ||
"message": "Please use Object.defineProperty instead." | ||
}, { | ||
"property": "__defineSetter__", | ||
"message": "Please use Object.defineProperty instead." | ||
}, { | ||
"object": "Math", | ||
"property": "pow", | ||
"message": "Use the exponentiation operator (**) instead." | ||
}], | ||
"no-self-compare": "error", | ||
"no-undef-init": "error", | ||
"no-useless-catch": "error", | ||
"no-useless-computed-key": "error", | ||
"no-useless-return": "error", | ||
"no-with": "error", | ||
"prefer-const": ["error", { | ||
"destructuring": "any", | ||
"ignoreReadBeforeAssign": true | ||
}], | ||
"template-curly-spacing": "error", | ||
"yoda": "error" | ||
} | ||
} |
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
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
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
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
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
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
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
Oops, something went wrong.
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.
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.
One unfortunate thing about this is that our tests could randomly start failing because of a change introduced in a minor/patch release of Jest 26 or 27. Some alternatives I can think of:
["local", "26.6.3", "27.0.4"]
)devDependencies
like so:Then we would need to do something like
JEST_BIN=./node_modules/jest-26/bin/jest.js
to switch between them.I slightly prefer the second option, because the versions would go in the yarn lockfile and therefore would be part of Circle CI's yarn cache. Also it would be easier to remember to update these versions, rather than keeping them in
.circleci/config.yml
.On the other hand, the second option is more complex and unusual. So I could go either way.
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.
Sounds like a feature to me! It would be great to run tests on every jest release but perhaps installing
latest
per run is the next best thing?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.
Yes, it is the intended behavior. Because we are using
^
to match against the jest peer dependency version, we don't have much control over the version of jest consumers' uses.Ideally, we would need to run the test every time a new version of jest is published to catch bugs earlier. But it would be overengineering this issue.
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.
Here's what I'm concerned about:
If we really want to stay on top of Jest updates, the solution IMO is something like Dependabot, not "random breakages when someone opens a PR or clones the projects and tries to test it." That doesn't even solve the problem, because the update cadence aligns with updates to this project, not updates to Jest.
To be fair, though, I don't know if Dependabot is smart enough to understand the
npm:package@version
syntax. So this problem may be unsolveable.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.
@nolanlawson Agreed. Maybe we can add jest updates to the list of tasks for the weekly trust hero?
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.
This is why there are 3 different builds in the matrix: "local", "26", "27"
local
build checks if the jest version frozen in the lockfile pass the tests26
and27
builds checks if the latest versions of jest pass the testsIf the
local
build pass and either26
or27
fails, it means that there is a regression or a bug in the latest version of Jest.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.
OK, fair enough.