Skip to content

Commit

Permalink
feat: upgrade to jest v28 (#463)
Browse files Browse the repository at this point in the history
  • Loading branch information
G-Rath committed Jul 9, 2022
1 parent 9382228 commit 23a5f52
Show file tree
Hide file tree
Showing 4 changed files with 411 additions and 894 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Expand Up @@ -16,7 +16,7 @@ jobs:
fail-fast: false
matrix:
node-version: [14.x, 16.x, 18.x]
jest-version: [27]
jest-version: [27, 28]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down
11 changes: 6 additions & 5 deletions package.json
Expand Up @@ -37,25 +37,26 @@
"@babel/cli": "^7.0.0",
"@babel/core": "^7.0.0",
"@babel/preset-env": "^7.14.7",
"@types/jest": "^27.0.2",
"babel-jest": "^27.2.4",
"@jest/expect-utils": "^28.0.0",
"@types/jest": "^28.0.0",
"babel-jest": "^28.0.0",
"babel-jest-assertions": "^0.1.0",
"eslint": "^8.0.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-import": "^2.8.0",
"eslint-plugin-jest": "^26.0.0",
"eslint-plugin-prettier": "^4.0.0",
"husky": "^7.0.1",
"jest": "^27.2.5",
"jest": "^28.0.0",
"jest-serializer-ansi-escapes": "^2.0.1",
"jest-watch-typeahead": "^1.0.0",
"lint-staged": "^12.0.0",
"prettier": "^2.3.2",
"typescript": "^4.4.3"
},
"dependencies": {
"jest-diff": "^27.2.5",
"jest-get-type": "^27.0.6"
"jest-diff": "^28.0.0",
"jest-get-type": "^28.0.0"
},
"engines": {
"node": "^14.15.0 || ^16.13.0 || >=18.0.0"
Expand Down
15 changes: 14 additions & 1 deletion test/utils/index.test.js
@@ -1,6 +1,19 @@
import { equals } from 'expect/build/jasmineUtils';
import { contains, determinePropertyMessage, isJestMockOrSpy } from 'src/utils';

let equals;

try {
// eslint-disable-next-line import/no-unresolved
equals = require('@jest/expect-utils').equals;
} catch (error) {
if (error.code === 'MODULE_NOT_FOUND') {
// eslint-disable-next-line import/no-unresolved
equals = require('expect/build/jasmineUtils').equals;
} else {
throw error;
}
}

describe('Utils', () => {
describe('.contains', () => {
const fn = () => {};
Expand Down

0 comments on commit 23a5f52

Please sign in to comment.