Skip to content

Commit

Permalink
build: remove next dependency for the Jest configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
Robbert committed Oct 5, 2024
1 parent e4515df commit b8c9243
Show file tree
Hide file tree
Showing 6 changed files with 491 additions and 145 deletions.
22 changes: 0 additions & 22 deletions packages/component-library-react/jest.config.mjs

This file was deleted.

27 changes: 27 additions & 0 deletions packages/component-library-react/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import type { Config } from 'jest';

const config: Config = {
coverageDirectory: '../coverage/',
coverageProvider: 'v8',
extensionsToTreatAsEsm: ['.ts', '.tsx'],
moduleDirectories: ['node_modules', '<rootDir>/'],
moduleNameMapper: {
'^@utrecht/(.*)$': '<rootDir>/../../components-react/$1/src/',
},
rootDir: './src/',
setupFilesAfterEnv: ['<rootDir>/setupJest.ts'],
testEnvironment: 'jest-environment-jsdom',
testPathIgnorePatterns: ['/dist/'],
transform: {
'^.+\\.(ts|tsx)?$': [
'ts-jest',
{
useESM: true,
},
],
},
transformIgnorePatterns: ['node_modules'],
verbose: true,
};

export default config;
12 changes: 6 additions & 6 deletions packages/component-library-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
"build": "pnpm run '/^build:.*/'",
"build:rollup": "rollup --config rollup.config.mjs",
"build:rollup-components": "rollup --config rollup-components.config.mjs",
"build:test-results": "mkdir -p dist pages && jest --json --outputFile=dist/.jest-test-results.json --silent",
"clean": "rimraf dist/ pages/ .rollup.cache/ .swc",
"build:test-results": "jest --json --outputFile=dist/.jest-test-results.json --silent",
"clean": "rimraf dist/ .rollup.cache/ .swc",
"lint-build": "tsc --project ./tsconfig.json --noEmit && tsc --project ./tsconfig.test.json",
"test": "mkdir -p pages && jest --coverage --verbose",
"test": "jest --coverage --verbose",
"watch:build": "rollup -c --watch",
"watch:test": "jest --verbose --watch"
},
Expand All @@ -51,8 +51,8 @@
"@rollup/plugin-json": "6.1.0",
"@rollup/plugin-node-resolve": "15.2.3",
"@testing-library/dom": "8.20.1",
"@testing-library/jest-dom": "5.17.0",
"@testing-library/react": "13.4.0",
"@testing-library/jest-dom": "6.4.5",
"@testing-library/react": "15.0.7",
"@testing-library/user-event": "14.5.1",
"@types/jest": "29.5.11",
"@types/lodash.chunk": "4.2.9",
Expand Down Expand Up @@ -156,7 +156,7 @@
"gatsby": "5.12.12",
"jest": "29.7.0",
"jest-environment-jsdom": "29.7.0",
"next": "13.5.6",
"next": "14.2.14",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-vega": "7.6.0",
Expand Down
2 changes: 0 additions & 2 deletions packages/component-library-react/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ export default [
include: /node_modules/,
}),
nodePolyfills(),
// del({ targets: ['dist/*', 'pages/*'] }),
typescript({ includeDependencies: false }),
json(),
babel({
Expand Down Expand Up @@ -89,7 +88,6 @@ export default [
include: /node_modules/,
}),
nodePolyfills(),
// del({ targets: ['dist/*', 'pages/*'] }),
postcss({
extensions: ['.css', '.scss'],
minimize: true,
Expand Down
1 change: 1 addition & 0 deletions packages/component-library-react/src/setupJest.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import '@testing-library/jest-dom/jest-globals';
Loading

0 comments on commit b8c9243

Please sign in to comment.