Skip to content

Commit 50b4a71

Browse files
committed
test: fix shell for windows tests
1 parent c509c64 commit 50b4a71

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

.github/workflows/run-tests.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,16 @@ jobs:
3535
node-version: ${{ matrix.node }}
3636

3737
- name: Install dependencies
38+
shell: bash
3839
run: npm ci
3940

4041
- name: Disable AppArmor
4142
if: ${{ matrix.os == 'ubuntu-latest' }}
43+
shell: bash
4244
run: echo 0 | sudo tee /proc/sys/kernel/apparmor_restrict_unprivileged_userns
4345

4446
- name: Run tests
47+
shell: bash
4548
run: npm run test
4649

4750
# Gating job for branch protection.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
"docs:generate": "node --experimental-strip-types scripts/generate-docs.ts",
1717
"start": "npm run build && node build/src/index.js",
1818
"start-debug": "DEBUG=mcp:* DEBUG_COLORS=false npm run build && node build/src/index.js",
19-
"test": "npm run build && node --require ./build/tests/setup.js --test-reporter spec --test-force-exit --test 'build/tests/**/*.test.js'",
20-
"test:only": "npm run build && node --require ./build/tests/setup.js --test-reporter spec --test-force-exit --test --test-only 'build/tests/**/*.test.js'",
21-
"test:only:no-build": "node --require ./build/tests/setup.js --test-reporter spec --test-force-exit --test --test-only 'build/tests/**/*.test.js'",
22-
"test:update-snapshots": "npm run build && node --require ./build/tests/setup.js --test-force-exit --test --test-update-snapshots 'build/tests/**/*.test.js'",
19+
"test": "npm run build && node --require ./build/tests/setup.js --test-reporter spec --test-force-exit --test \"build/tests/**/*.test.js\"",
20+
"test:only": "npm run build && node --require ./build/tests/setup.js --test-reporter spec --test-force-exit --test --test-only \"build/tests/**/*.test.js\"",
21+
"test:only:no-build": "node --require ./build/tests/setup.js --test-reporter spec --test-force-exit --test --test-only \"build/tests/**/*.test.js\"",
22+
"test:update-snapshots": "npm run build && node --require ./build/tests/setup.js --test-force-exit --test --test-update-snapshots \"build/tests/**/*.test.js\"",
2323
"prepare": "node --experimental-strip-types scripts/prepare.ts"
2424
},
2525
"files": [

tests/setup.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66
import {it} from 'node:test';
7+
import path from 'node:path';
78

89
// This is run by Node when we execute the tests via the --require flag.
910
it.snapshot.setResolveSnapshotPath(testPath => {
1011
// By default the snapshots go into the build directory, but we want them
1112
// in the tests/ directory.
12-
const correctPath = testPath?.replace('/build/tests', '/tests');
13+
const correctPath = testPath?.replace(path.join('build', 'tests'), 'tests');
1314
return correctPath + '.snapshot';
1415
});
1516

0 commit comments

Comments
 (0)