Chrome DevTools for coding agents
test: fix shell for windows tests (#72)
Alex Rudenko91d83c41905a
diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.ymlindex 47b2e958..fd144d9d 100644--- a/.github/workflows/run-tests.yml+++ b/.github/workflows/run-tests.yml@@ -35,13 +35,16 @@ jobs:node-version: ${{ matrix.node }}- name: Install dependencies+ shell: bashrun: npm ci- name: Disable AppArmorif: ${{ matrix.os == 'ubuntu-latest' }}+ shell: bashrun: echo 0 | sudo tee /proc/sys/kernel/apparmor_restrict_unprivileged_userns- name: Run tests+ shell: bashrun: npm run test# Gating job for branch protection.diff --git a/package.json b/package.jsonindex 5dd92bcd..21081352 100644--- a/package.json+++ b/package.json@@ -16,10 +16,10 @@"docs:generate": "node --experimental-strip-types scripts/generate-docs.ts","start": "npm run build && node build/src/index.js","start-debug": "DEBUG=mcp:* DEBUG_COLORS=false npm run build && node build/src/index.js",- "test": "npm run build && node --require ./build/tests/setup.js --test-reporter spec --test-force-exit --test 'build/tests/**/*.test.js'",- "test:only": "npm run build && node --require ./build/tests/setup.js --test-reporter spec --test-force-exit --test --test-only 'build/tests/**/*.test.js'",- "test:only:no-build": "node --require ./build/tests/setup.js --test-reporter spec --test-force-exit --test --test-only 'build/tests/**/*.test.js'",- "test:update-snapshots": "npm run build && node --require ./build/tests/setup.js --test-force-exit --test --test-update-snapshots 'build/tests/**/*.test.js'",+ "test": "npm run build && node --require ./build/tests/setup.js --test-reporter spec --test-force-exit --test \"build/tests/**/*.test.js\"",+ "test:only": "npm run build && node --require ./build/tests/setup.js --test-reporter spec --test-force-exit --test --test-only \"build/tests/**/*.test.js\"",+ "test:only:no-build": "node --require ./build/tests/setup.js --test-reporter spec --test-force-exit --test --test-only \"build/tests/**/*.test.js\"",+ "test:update-snapshots": "npm run build && node --require ./build/tests/setup.js --test-force-exit --test --test-update-snapshots \"build/tests/**/*.test.js\"","prepare": "node --experimental-strip-types scripts/prepare.ts"},"files": [diff --git a/tests/setup.ts b/tests/setup.tsindex 40ea2b91..b9690a15 100644--- a/tests/setup.ts+++ b/tests/setup.ts@@ -4,12 +4,13 @@* SPDX-License-Identifier: Apache-2.0*/import {it} from 'node:test';+import path from 'node:path';// This is run by Node when we execute the tests via the --require flag.it.snapshot.setResolveSnapshotPath(testPath => {// By default the snapshots go into the build directory, but we want them// in the tests/ directory.- const correctPath = testPath?.replace('/build/tests', '/tests');+ const correctPath = testPath?.replace(path.join('build', 'tests'), 'tests');return correctPath + '.snapshot';});diff --git a/tests/tools/screenshot.test.ts b/tests/tools/screenshot.test.tsindex ec018227..12d00c7b 100644--- a/tests/tools/screenshot.test.ts+++ b/tests/tools/screenshot.test.ts@@ -64,7 +64,7 @@ describe('screenshot', () => {await withBrowser(async (response, context) => {const page = context.getSelectedPage();await page.setContent(- `<div style="color:blue;">test</div>`.repeat(5_000),+ `<div style="color:blue;">test</div>`.repeat(7_000),);await screenshot.handler({params: {format: 'png', fullPage: true}},