Skip to content

Commit

Permalink
Merge pull request #19863 from storybookjs/upgrade-jest-29
Browse files Browse the repository at this point in the history
Build: Upgrade Jest to 29
  • Loading branch information
kasperpeulen authored Nov 17, 2022
2 parents 1dbd012 + 1b151d4 commit 609ba77
Show file tree
Hide file tree
Showing 14 changed files with 1,555 additions and 635 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ jobs:
name: Test
command: |
cd code
yarn test --coverage --ci --runInBand
yarn test --coverage --ci --maxWorkers=6
- store_test_results:
path: code/junit.xml
- persist_to_workspace:
Expand Down
2 changes: 1 addition & 1 deletion code/addons/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
},
"dependencies": {
"@babel/plugin-transform-react-jsx": "^7.19.0",
"@jest/transform": "^28.0.0",
"@jest/transform": "^29.3.1",
"@mdx-js/react": "^2.1.5",
"@storybook/blocks": "7.0.0-alpha.50",
"@storybook/components": "7.0.0-alpha.50",
Expand Down
4 changes: 2 additions & 2 deletions code/addons/storyshots/storyshots-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"storybook": "yarn sb dev -p 6006"
},
"dependencies": {
"@jest/transform": "^28.0.0",
"@jest/transform": "^29.3.1",
"@storybook/addons": "7.0.0-alpha.50",
"@storybook/babel-plugin-require-context-hook": "1.0.1",
"@storybook/client-api": "7.0.0-alpha.50",
Expand All @@ -46,7 +46,7 @@
"@storybook/core-webpack": "7.0.0-alpha.50",
"@storybook/types": "7.0.0-alpha.50",
"@types/glob": "^7.1.3",
"@types/jest-specific-snapshot": "^0.5.3",
"@types/jest-specific-snapshot": "^0.5.6",
"core-js": "^3.8.2",
"glob": "^7.1.6",
"global": "^4.4.0",
Expand Down
4 changes: 2 additions & 2 deletions code/addons/storyshots/storyshots-puppeteer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
"@storybook/csf": "0.0.2-next.7",
"@storybook/node-logger": "7.0.0-alpha.50",
"@storybook/types": "7.0.0-alpha.50",
"@types/jest-image-snapshot": "^4.1.3",
"jest-image-snapshot": "^4.3.0"
"@types/jest-image-snapshot": "^5.1.0",
"jest-image-snapshot": "^6.0.0"
},
"devDependencies": {
"@types/puppeteer": "^5.4.0",
Expand Down
2 changes: 1 addition & 1 deletion code/frameworks/angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
"@types/rimraf": "^3.0.2",
"@types/tmp": "^0.2.3",
"cross-spawn": "^7.0.3",
"jest": "^28.0.0",
"jest": "^29.3.1",
"jest-preset-angular": "^12.0.0",
"jest-specific-snapshot": "^6.0.0",
"rimraf": "^3.0.2",
Expand Down
12 changes: 0 additions & 12 deletions code/jest.config.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,6 @@ module.exports = {
'/renderers/vue3/src/public-types.test.ts',
...(process.platform === 'win32' ? skipOnWindows : []),
],
collectCoverage: false,
collectCoverageFrom: [
'frameworks/*/src/**/*.{js,jsx,ts,tsx}',
'lib/*/src/**/*.{js,jsx,ts,tsx}',
'renderers/*/src/**/*.{js,jsx,ts,tsx}',
'addons/*/src/**/*.{js,jsx,ts,tsx}',
'ui/*/src/**/*.{js,jsx,ts,tsx}',
],
coveragePathIgnorePatterns: [
'/node_modules/',
'/cli/test/',
Expand All @@ -85,8 +77,6 @@ module.exports = {
SNAPSHOT_OS: os.platform() === 'win32' ? 'windows' : 'posix',
},
snapshotSerializers: ['@emotion/jest/serializer', 'jest-serializer-html'],
coverageDirectory: 'coverage',
coverageReporters: ['lcov'],
testEnvironmentOptions: {
url: 'http://localhost',
},
Expand All @@ -97,8 +87,6 @@ module.exports = {
'/template/',
],
moduleFileExtensions: ['js', 'jsx', 'ts', 'tsx', 'json', 'node'],
watchPlugins: ['jest-watch-typeahead/filename', 'jest-watch-typeahead/testname'],
reporters: ['default', 'jest-junit'],
snapshotFormat: {
escapeString: true,
printBasicPrototype: true,
Expand Down
12 changes: 12 additions & 0 deletions code/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,16 @@ module.exports = {
'<rootDir>/renderers/*',
'<rootDir>/ui/*',
],
collectCoverage: false,
collectCoverageFrom: [
'frameworks/*/src/**/*.{js,jsx,ts,tsx}',
'lib/*/src/**/*.{js,jsx,ts,tsx}',
'renderers/*/src/**/*.{js,jsx,ts,tsx}',
'addons/*/src/**/*.{js,jsx,ts,tsx}',
'ui/*/src/**/*.{js,jsx,ts,tsx}',
],
coverageDirectory: 'coverage',
coverageReporters: ['lcov'],
reporters: ['default', 'jest-junit'],
watchPlugins: ['jest-watch-typeahead/filename', 'jest-watch-typeahead/testname'],
};
2 changes: 1 addition & 1 deletion code/lib/codemod/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"util": "^0.12.4"
},
"devDependencies": {
"jest": "^28.0.0",
"jest": "^29.3.1",
"jest-specific-snapshot": "^6.0.0",
"typescript": "^4.9.3"
},
Expand Down
2 changes: 1 addition & 1 deletion code/lib/postinstall/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"prep": "../../../scripts/prepare/bundle.ts"
},
"devDependencies": {
"jest": "^28.0.0",
"jest": "^29.3.1",
"jest-specific-snapshot": "^6.0.0",
"jscodeshift": "^0.13.1",
"typescript": "^4.9.3"
Expand Down
16 changes: 8 additions & 8 deletions code/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
"@compodoc/compodoc": "^1.1.18",
"@emotion/babel-plugin": "^11.10.2",
"@emotion/jest": "^11.10.0",
"@jest/globals": "^28.0.0",
"@jest/globals": "^29.3.1",
"@linear/sdk": "^1.21.0",
"@nrwl/cli": "14.6.1",
"@nrwl/nx-cloud": "14.6.0",
Expand Down Expand Up @@ -260,7 +260,7 @@
"@vitejs/plugin-react": "^2.1.0",
"babel-core": "^7.0.0-bridge.0",
"babel-eslint": "^10.1.0",
"babel-jest": "^28.1.3",
"babel-jest": "^29.3.1",
"babel-loader": "^8.3.0",
"babel-plugin-add-react-displayname": "^0.0.5",
"babel-plugin-dynamic-import-node": "^2.3.3",
Expand Down Expand Up @@ -292,13 +292,13 @@
"global": "^4.4.0",
"http-server": "^0.12.3",
"husky": "^4.3.7",
"jest": "^28.0.0",
"jest-environment-jsdom": "^28.0.0",
"jest-image-snapshot": "^4.3.0",
"jest-junit": "^13.0.0",
"jest": "^29.3.1",
"jest-environment-jsdom": "^29.3.1",
"jest-image-snapshot": "^6.0.0",
"jest-junit": "^14.0.1",
"jest-os-detection": "^1.3.1",
"jest-serializer-html": "^7.0.0",
"jest-watch-typeahead": "^0.6.1",
"jest-serializer-html": "^7.1.0",
"jest-watch-typeahead": "^2.2.1",
"js-yaml": "^3.14.1",
"lerna": "^3.22.1",
"lint-staged": "^10.5.4",
Expand Down
2 changes: 1 addition & 1 deletion code/renderers/vue3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
},
"devDependencies": {
"@digitak/esrun": "^3.2.2",
"@vue/vue3-jest": "28",
"@vue/vue3-jest": "29",
"typescript": "^4.9.3",
"vue": "^3.2.41",
"vue-tsc": "^1.0.8"
Expand Down
Loading

0 comments on commit 609ba77

Please sign in to comment.