Skip to content

Commit 23155f9

Browse files
committed
Avoided downloading a browser.
1 parent af43bbb commit 23155f9

3 files changed

Lines changed: 7 additions & 6 deletions

File tree

.npmrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# tape-six-puppeteer's postinstall downloads Chrome; a corrupt download once failed
2+
# `npm ci` in CI before any test ran. Install the browser by hand instead:
3+
# `npm run browser:install`.
4+
ignore-scripts=true

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ npm install
2323
- **Test (Bun):** `npm run test:bun`
2424
- **Test (Deno):** `npm run test:deno`
2525
- **Test (sequential):** `npm run test:seq` (also `test:seq:bun`, `test:seq:deno`)
26-
- **Test (browser):** `npm run test:browser` — drives headless Chromium via `tape-six-puppeteer`; auto-starts `tape6-server` on port `55555` (env-overridable, avoids the default `3000` collision). Browser-safe test set is selected by `tape6.tests` (`tests/core/` + `tests/web/`); `tape6.cli` (`tests/node/`) is skipped in browser context. Nothing downloads at install time: `allowScripts` explicitly denies the `tape-six-puppeteer` / `puppeteer` postinstalls (npm's unreviewed-script warning is advisory — only explicit `false` blocks; denial also unlinks those packages' bins, hence the script's direct-path invocation) and `.puppeteerrc.cjs` sets `skipDownload`. The browser resolves from puppeteer's cache (one-time `npx puppeteer browsers install chrome`) or `PUPPETEER_EXECUTABLE_PATH`.
26+
- **Test (browser):** `npm run test:browser` — drives headless Chromium via `tape-six-puppeteer`; auto-starts `tape6-server` on port `55555` (env-overridable, avoids the default `3000` collision). Browser-safe test set is selected by `tape6.tests` (`tests/core/` + `tests/web/`); `tape6.cli` (`tests/node/`) is skipped in browser context. Nothing downloads at install time: `.npmrc` sets `ignore-scripts=true`, which blocks the `tape-six-puppeteer` / `puppeteer` postinstalls on every npm version, and `.puppeteerrc.cjs` sets `skipDownload`. Do not swap it for `package.json`'s `allowScripts` — that field needs npm 11.16+, so it is silently ignored by the npm 10.9 that Node 22 bundles, and the CI matrix still tests Node 22. The browser resolves from puppeteer's cache (one-time `npm run browser:install`) or `PUPPETEER_EXECUTABLE_PATH`.
2727
- **Test (single file):** `node tests/<bucket>/test-<name>.js` (bucket is `core`, `web`, or `node`)
2828
- **TypeScript check:** `npm run ts-check`
2929
- **JavaScript type check (dual tsconfig):** `npm run js-check`

package.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
"test:seq": "tape6-seq --flags FO",
2525
"test:seq:bun": "bun run `tape6-seq --self` --flags FO",
2626
"test:seq:deno": "deno run -A `tape6-seq --self` --flags FO",
27-
"test:browser": "node node_modules/tape-six-puppeteer/bin/tape6-puppeteer.js --server-url http://localhost:55555 --start-server --flags FO",
27+
"test:browser": "tape6-puppeteer --server-url http://localhost:55555 --start-server --flags FO",
28+
"browser:install": "npx puppeteer browsers install chrome",
2829
"ts-check": "tsc --noEmit",
2930
"js-check": "tsc --project tsconfig.check.json",
3031
"ts-test": "tape6 --flags FO 'tests/**/test-*.*ts'",
@@ -92,9 +93,5 @@
9293
"tape-six-proc": "^1.3.1",
9394
"tape-six-puppeteer": "^1.2.2",
9495
"typescript": "^7.0.2"
95-
},
96-
"allowScripts": {
97-
"tape-six-puppeteer": false,
98-
"puppeteer": false
9996
}
10097
}

0 commit comments

Comments
 (0)