Skip to content

Commit 99ed31e

Browse files
romtsnclaude
andcommitted
fix(ci): Install native bindings after npm install
Jest 30 uses @unrs/resolver which requires platform-specific native binaries installed via napi-postinstall. Since we use --ignore-scripts to skip our own postinstall, we need to explicitly run napi-postinstall afterwards to install the resolver bindings. Reverts jest.config.js and setupTests.js to their original state since the root cause was missing native bindings, not path resolution. Co-Authored-By: Claude Opus 4.6 <[email protected]>
1 parent 9bda8c8 commit 99ed31e

3 files changed

Lines changed: 10 additions & 5 deletions

File tree

.github/workflows/test_node.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,11 @@ jobs:
9696
if: ${{ inputs.triggered-by-release }}
9797
run: npm install --omit=optional --ignore-scripts
9898

99+
# --ignore-scripts skips napi-postinstall which installs native resolver
100+
# bindings required by Jest 30's @unrs/resolver
101+
- name: Install native bindings
102+
run: npx napi-postinstall
103+
99104
- name: Download build artifact
100105
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # 8.0.0
101106
with:

jest.config.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
const path = require('path');
2-
3-
process.env.SENTRY_BINARY_PATH = path.join(__dirname, 'lib', '__mocks__', 'sentry-cli');
4-
51
module.exports = {
62
collectCoverage: true,
73
testEnvironment: 'node',
8-
testPathIgnorePatterns: ['./src/', './tests/integration/'],
4+
setupFiles: ['<rootDir>/setupTests.js'],
5+
testPathIgnorePatterns: ['<rootDir>/src/', '<rootDir>/tests/integration/'],
96
transform: {
107
'^.+\\.ts$': 'ts-jest',
118
},

setupTests.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
const path = require('path');
2+
3+
process.env.SENTRY_BINARY_PATH = path.join(__dirname, 'lib', '__mocks__', 'sentry-cli');

0 commit comments

Comments
 (0)