Skip to content

Commit 3d4dced

Browse files
committed
Fix Windows Jest setup resolution in CI
1 parent c9d9d35 commit 3d4dced

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939

4040
- name: Install extension dependencies
4141
working-directory: extension-repo
42-
run: npm ci --ignore-scripts --omit=optional
42+
run: npm ci --ignore-scripts --omit=optional --include=dev
4343

4444
- name: Install core dependencies
4545
working-directory: paranext-core
@@ -78,7 +78,7 @@ jobs:
7878

7979
- name: Install extension dependencies
8080
working-directory: extension-repo
81-
run: npm ci --ignore-scripts
81+
run: npm ci --ignore-scripts --include=dev
8282

8383
- name: Install core dependencies
8484
working-directory: paranext-core

jest.config.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,13 @@ const config: Config = {
108108
/** Exclude dist from module resolution to avoid Haste naming collision with root package.json. */
109109
modulePathIgnorePatterns: ['<rootDir>/dist'],
110110

111-
/** Load @testing-library/jest-dom matchers for React component tests. */
112-
setupFilesAfterEnv: ['@testing-library/jest-dom'],
111+
/**
112+
* Load jest-dom matchers for React tests.
113+
*
114+
* Using the concrete file path avoids occasional package-name resolution failures during Jest's
115+
* config validation on Windows CI.
116+
*/
117+
setupFilesAfterEnv: ['<rootDir>/node_modules/@testing-library/jest-dom/dist/index.js'],
113118

114119
/** Use jsdom for React component tests; parser tests run fine in jsdom (no DOM use). */
115120
testEnvironment: 'jsdom',

0 commit comments

Comments
 (0)