Skip to content

Commit

Permalink
chore: migrate jest configs from using deprecated globals to `transfo…
Browse files Browse the repository at this point in the history
…rm` property/pattern (#28317)

* feat(tools): jest29 configs - update migrate converged generator

* test(tools): add jest isolatedModules config

* chore: migrate jest.config.js from using deprecated globals to transform options

* test: update all scripts/ jest setups to not use type checking to improve test performance

* test(tools): update snapshots after nx 15 migration resolved formatting issues in generators
  • Loading branch information
Hotell committed Jun 28, 2023
1 parent 55b25f7 commit 353f6d9
Show file tree
Hide file tree
Showing 105 changed files with 724 additions and 573 deletions.
14 changes: 7 additions & 7 deletions apps/react-18-tests-v9/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
module.exports = {
displayName: 'react-18-tests-v9',
preset: '../../jest.preset.js',
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig.spec.json',
isolatedModules: true,
},
},
transform: {
'^.+\\.tsx?$': 'ts-jest',
'^.+\\.tsx?$': [
'ts-jest',
{
tsconfig: '<rootDir>/tsconfig.spec.json',
isolatedModules: true,
},
],
},
coverageDirectory: './coverage',
setupFilesAfterEnv: ['./config/tests.js'],
Expand Down
14 changes: 7 additions & 7 deletions apps/ssr-tests-v9/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
module.exports = {
displayName: 'ssr-tests-v9',
preset: '../../jest.preset.js',
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig.spec.json',
isolatedModules: true,
},
},
transform: {
'^.+\\.tsx?$': 'ts-jest',
'^.+\\.tsx?$': [
'ts-jest',
{
tsconfig: '<rootDir>/tsconfig.spec.json',
isolatedModules: true,
},
],
},
testEnvironment: 'node',
coverageDirectory: './coverage',
Expand Down
14 changes: 7 additions & 7 deletions apps/stress-test/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
module.exports = {
displayName: 'ssr-tests-v9',
preset: '../../jest.preset.js',
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig.spec.json',
isolatedModules: true,
},
},
transform: {
'^.+\\.tsx?$': 'ts-jest',
'^.+\\.tsx?$': [
'ts-jest',
{
tsconfig: '<rootDir>/tsconfig.spec.json',
isolatedModules: true,
},
],
},
testEnvironment: 'node',
coverageDirectory: './coverage',
Expand Down
14 changes: 7 additions & 7 deletions apps/vr-tests-react-components/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
module.exports = {
displayName: 'vr-tests-react-components',
preset: '../../jest.preset.js',
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig.json',
isolatedModules: true,
},
},
transform: {
'^.+\\.tsx?$': 'ts-jest',
'^.+\\.tsx?$': [
'ts-jest',
{
tsconfig: '<rootDir>/tsconfig.json',
isolatedModules: true,
},
],
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
module.exports = {
displayName: 'babel-preset-global-context',
preset: '../../../jest.preset.js',
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig.spec.json',
isolatedModules: true,
},
},
transform: {
'^.+\\.tsx?$': 'ts-jest',
'^.+\\.tsx?$': [
'ts-jest',
{
tsconfig: '<rootDir>/tsconfig.spec.json',
isolatedModules: true,
},
],
},
coverageDirectory: './coverage',
setupFilesAfterEnv: ['./config/tests.js'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
module.exports = {
displayName: 'babel-preset-storybook-full-source',
preset: '../../../jest.preset.js',
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig.spec.json',
isolatedModules: true,
},
},
transform: {
'^.+\\.tsx?$': 'ts-jest',
'^.+\\.tsx?$': [
'ts-jest',
{
tsconfig: '<rootDir>/tsconfig.spec.json',
isolatedModules: true,
},
],
},
coverageDirectory: './coverage',
setupFilesAfterEnv: ['./config/tests.js'],
Expand Down
14 changes: 7 additions & 7 deletions packages/react-components/global-context/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
module.exports = {
displayName: 'global-context',
preset: '../../../jest.preset.js',
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig.spec.json',
isolatedModules: true,
},
},
transform: {
'^.+\\.tsx?$': 'ts-jest',
'^.+\\.tsx?$': [
'ts-jest',
{
tsconfig: '<rootDir>/tsconfig.spec.json',
isolatedModules: true,
},
],
},
coverageDirectory: './coverage',
setupFilesAfterEnv: ['./config/tests.js'],
Expand Down
14 changes: 7 additions & 7 deletions packages/react-components/keyboard-keys/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
module.exports = {
displayName: 'keyboard-keys',
preset: '../../../jest.preset.js',
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig.spec.json',
isolatedModules: true,
},
},
transform: {
'^.+\\.tsx?$': 'ts-jest',
'^.+\\.tsx?$': [
'ts-jest',
{
tsconfig: '<rootDir>/tsconfig.spec.json',
isolatedModules: true,
},
],
},
coverageDirectory: './coverage',
setupFilesAfterEnv: ['./config/tests.js'],
Expand Down
14 changes: 7 additions & 7 deletions packages/react-components/priority-overflow/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
module.exports = {
displayName: 'priority-overflow',
preset: '../../../jest.preset.js',
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig.spec.json',
isolatedModules: true,
},
},
transform: {
'^.+\\.tsx?$': 'ts-jest',
'^.+\\.tsx?$': [
'ts-jest',
{
tsconfig: '<rootDir>/tsconfig.spec.json',
isolatedModules: true,
},
],
},
coverageDirectory: './coverage',
setupFilesAfterEnv: ['./config/tests.js'],
Expand Down
14 changes: 7 additions & 7 deletions packages/react-components/react-accordion/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
module.exports = {
displayName: 'react-accordion',
preset: '../../../jest.preset.js',
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig.spec.json',
isolatedModules: true,
},
},
transform: {
'^.+\\.tsx?$': 'ts-jest',
'^.+\\.tsx?$': [
'ts-jest',
{
tsconfig: '<rootDir>/tsconfig.spec.json',
isolatedModules: true,
},
],
},
coverageDirectory: './coverage',
setupFilesAfterEnv: ['./config/tests.js'],
Expand Down
14 changes: 7 additions & 7 deletions packages/react-components/react-alert/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
module.exports = {
displayName: 'react-alert',
preset: '../../../jest.preset.js',
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig.spec.json',
isolatedModules: true,
},
},
transform: {
'^.+\\.tsx?$': 'ts-jest',
'^.+\\.tsx?$': [
'ts-jest',
{
tsconfig: '<rootDir>/tsconfig.spec.json',
isolatedModules: true,
},
],
},
coverageDirectory: './coverage',
setupFilesAfterEnv: ['./config/tests.js'],
Expand Down
14 changes: 7 additions & 7 deletions packages/react-components/react-aria/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
module.exports = {
displayName: 'react-aria',
preset: '../../../jest.preset.js',
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig.spec.json',
isolatedModules: true,
},
},
transform: {
'^.+\\.tsx?$': 'ts-jest',
'^.+\\.tsx?$': [
'ts-jest',
{
tsconfig: '<rootDir>/tsconfig.spec.json',
isolatedModules: true,
},
],
},
coverageDirectory: './coverage',
setupFilesAfterEnv: ['./config/tests.js'],
Expand Down
14 changes: 7 additions & 7 deletions packages/react-components/react-avatar/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
module.exports = {
displayName: 'react-avatar',
preset: '../../../jest.preset.js',
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig.spec.json',
isolatedModules: true,
},
},
transform: {
'^.+\\.tsx?$': 'ts-jest',
'^.+\\.tsx?$': [
'ts-jest',
{
tsconfig: '<rootDir>/tsconfig.spec.json',
isolatedModules: true,
},
],
},
coverageDirectory: './coverage',
setupFilesAfterEnv: ['./config/tests.js'],
Expand Down
14 changes: 7 additions & 7 deletions packages/react-components/react-badge/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
module.exports = {
displayName: 'react-badge',
preset: '../../../jest.preset.js',
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig.spec.json',
isolatedModules: true,
},
},
transform: {
'^.+\\.tsx?$': 'ts-jest',
'^.+\\.tsx?$': [
'ts-jest',
{
tsconfig: '<rootDir>/tsconfig.spec.json',
isolatedModules: true,
},
],
},
coverageDirectory: './coverage',
setupFilesAfterEnv: ['./config/tests.js'],
Expand Down
14 changes: 7 additions & 7 deletions packages/react-components/react-breadcrumb/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
module.exports = {
displayName: 'react-breadcrumb',
preset: '../../../jest.preset.js',
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig.spec.json',
isolatedModules: true,
},
},
transform: {
'^.+\\.tsx?$': 'ts-jest',
'^.+\\.tsx?$': [
'ts-jest',
{
tsconfig: '<rootDir>/tsconfig.spec.json',
isolatedModules: true,
},
],
},
coverageDirectory: './coverage',
setupFilesAfterEnv: ['./config/tests.js'],
Expand Down
14 changes: 7 additions & 7 deletions packages/react-components/react-button/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
module.exports = {
displayName: 'react-button',
preset: '../../../jest.preset.js',
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig.spec.json',
isolatedModules: true,
},
},
transform: {
'^.+\\.tsx?$': 'ts-jest',
'^.+\\.tsx?$': [
'ts-jest',
{
tsconfig: '<rootDir>/tsconfig.spec.json',
isolatedModules: true,
},
],
},
coverageDirectory: './coverage',
setupFilesAfterEnv: ['./config/tests.js'],
Expand Down
14 changes: 7 additions & 7 deletions packages/react-components/react-card/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
module.exports = {
displayName: 'react-card',
preset: '../../../jest.preset.js',
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig.spec.json',
isolatedModules: true,
},
},
transform: {
'^.+\\.tsx?$': 'ts-jest',
'^.+\\.tsx?$': [
'ts-jest',
{
tsconfig: '<rootDir>/tsconfig.spec.json',
isolatedModules: true,
},
],
},
coverageDirectory: './coverage',
setupFilesAfterEnv: ['./config/tests.js'],
Expand Down
14 changes: 7 additions & 7 deletions packages/react-components/react-checkbox/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
module.exports = {
displayName: 'react-checkbox',
preset: '../../../jest.preset.js',
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig.spec.json',
isolatedModules: true,
},
},
transform: {
'^.+\\.tsx?$': 'ts-jest',
'^.+\\.tsx?$': [
'ts-jest',
{
tsconfig: '<rootDir>/tsconfig.spec.json',
isolatedModules: true,
},
],
},
coverageDirectory: './coverage',
setupFilesAfterEnv: ['./config/tests.js'],
Expand Down
Loading

0 comments on commit 353f6d9

Please sign in to comment.