Skip to content

Commit

Permalink
Test(web-react): Use jest-config-spirit common preset
Browse files Browse the repository at this point in the history
  • Loading branch information
literat committed May 16, 2024
1 parent 6715bb5 commit 3239537
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 80 deletions.
62 changes: 0 additions & 62 deletions packages/web-react/config/jest/config.js

This file was deleted.

Empty file.
14 changes: 14 additions & 0 deletions packages/web-react/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const config = {
preset: 'jest-config-spirit/jsdom',

/**
* @TODO: Move this configuration to the `jest-config-spirit` preset
*
* @see: https://github.com/lmc-eu/spirit-design-system/issues/1413
*/
// A list of paths to modules that run some code to configure or set up the testing framework before each test file in the suite is executed.
// https://jestjs.io/docs/configuration#setupfilesafterenv-array
setupFilesAfterEnv: ['<rootDir>/config/jest/setupTestingLibrary.ts'],
};

export default config;
6 changes: 1 addition & 5 deletions packages/web-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@
"@lmc-eu/spirit-design-tokens": "^1.1.5",
"@lmc-eu/spirit-web": "^1.13.1",
"@rollup/plugin-node-resolve": "15.2.3",
"@swc/core": "1.5.7",
"@swc/jest": "0.2.36",
"@testing-library/dom": "9.3.4",
"@testing-library/jest-dom": "6.4.5",
"@testing-library/react": "14.3.1",
Expand All @@ -62,8 +60,6 @@
"eslint-plugin-standard": "5.0.0",
"glob": "10.3.15",
"jest": "29.7.0",
"jest-cli": "29.7.0",
"jest-environment-jsdom": "29.7.0",
"npm-run-all": "4.1.5",
"react": "18.3.1",
"react-dom": "18.3.1",
Expand Down Expand Up @@ -105,7 +101,7 @@
"lint": "eslint ./",
"lint:fix": "yarn lint --fix",
"test": "npm-run-all --serial lint types test:unit:coverage",
"test:unit": "jest --config ./config/jest/config.js",
"test:unit": "jest",
"test:unit:watch": "yarn test:unit --watchAll",
"test:unit:coverage": "yarn test:unit --coverage"
},
Expand Down
14 changes: 1 addition & 13 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3816,11 +3816,8 @@ __metadata:
resolution: "@lmc-eu/spirit-form-validations@workspace:packages/form-validations"
dependencies:
"@lmc-eu/browserslist-config": 2.0.0
"@swc/core": 1.5.7
"@swc/jest": 0.2.36
"@types/jest": 29.5.12
jest: 29.7.0
jest-environment-jsdom: 29.7.0
npm-run-all: 4.1.5
sass: 1.77.1
shx: 0.3.4
Expand Down Expand Up @@ -3887,8 +3884,6 @@ __metadata:
"@lmc-eu/spirit-web": ^1.13.1
"@react-hook/resize-observer": ^1.2.6
"@rollup/plugin-node-resolve": 15.2.3
"@swc/core": 1.5.7
"@swc/jest": 0.2.36
"@testing-library/dom": 9.3.4
"@testing-library/jest-dom": 6.4.5
"@testing-library/react": 14.3.1
Expand Down Expand Up @@ -3916,8 +3911,6 @@ __metadata:
html-dom-parser: 5.0.8
html-react-parser: 5.1.10
jest: 29.7.0
jest-cli: 29.7.0
jest-environment-jsdom: 29.7.0
npm-run-all: 4.1.5
react: 18.3.1
react-dom: 18.3.1
Expand Down Expand Up @@ -3962,19 +3955,14 @@ __metadata:
"@lmc-eu/spirit-icons": ^0.10.2
"@lmc-eu/stylelint-config": 7.0.1
"@rollup/plugin-typescript": 11.1.6
"@swc/core": 1.5.7
"@swc/jest": 0.2.36
"@types/jest": 29.5.12
autoprefixer: 10.4.19
clean-css-cli: 5.6.3
glob: 10.3.15
jest: 29.7.0
jest-environment-jsdom: 29.7.0
jest-environment-node-single-context: 29.4.0
npm-run-all: 4.1.5
postcss: 8.4.38
postcss-cli: 10.1.0
resize-observer-polyfill: 1.5.1
rollup: 3.29.4
rollup-plugin-terser: 7.0.2
sass: 1.77.1
Expand Down Expand Up @@ -25877,7 +25865,7 @@ __metadata:
languageName: node
linkType: hard

"resize-observer-polyfill@npm:1.5.1, resize-observer-polyfill@npm:^1.5.1":
"resize-observer-polyfill@npm:^1.5.1":
version: 1.5.1
resolution: "resize-observer-polyfill@npm:1.5.1"
checksum: 57e7f79489867b00ba43c9c051524a5c8f162a61d5547e99333549afc23e15c44fd43f2f318ea0261ea98c0eb3158cca261e6f48d66e1ed1cd1f340a43977094
Expand Down

0 comments on commit 3239537

Please sign in to comment.