mirror of
https://github.com/screentinker/screentinker.git
synced 2026-08-13 22:03:13 -06:00
Keep the smoke test out of npm test, and update the lockfile
Two mistakes in the previous commit, both of which broke CI. The lockfile was not regenerated after adding puppeteer-core to devDependencies, and `npm ci` requires the two to agree — so every job that installs dependencies failed before running anything. The smoke test was also placed in test/, which I described as keeping it out of `npm test`. It does not: `node --test` globs that directory, so the runner picked it up regardless of intent, tried to drive a browser as a unit test, and failed. It now lives beside the server as smoke-ui.js, with a note saying why, so the next person does not put it back. Verified the way it should have been the first time: npm ci succeeds, native modules still load, npm test is 807/807 with no browser involved, and `npm run smoke` is 32/32 on its own. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Uaeo9MvzKoyXuN6ZsbhtkL
This commit is contained in:
parent
29ae184b14
commit
3e3d0081fe
838
server/package-lock.json
generated
838
server/package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -7,7 +7,7 @@
|
|||
"start": "node --env-file-if-exists=.env server.js",
|
||||
"dev": "node --watch --env-file-if-exists=.env server.js",
|
||||
"test": "node --test --test-concurrency=2",
|
||||
"smoke": "node test/smoke/ui-smoke.js"
|
||||
"smoke": "node smoke-ui.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@azure/msal-node": "^5.2.1",
|
||||
|
|
|
|||
|
|
@ -4,6 +4,10 @@
|
|||
// and it boots a server and drives it. Run it deliberately:
|
||||
//
|
||||
// npm run smoke (skips cleanly if no Chrome is installed)
|
||||
//
|
||||
// It lives OUTSIDE test/ on purpose: `node --test` globs that directory, so a file placed
|
||||
// there is picked up by `npm test` no matter what the intent was — which is exactly what
|
||||
// happened the first time, and it broke CI.
|
||||
// CHROME=/path/to/chrome npm run smoke
|
||||
//
|
||||
// It exists because a whole class of defect is invisible to the unit suite, to a syntax check
|
||||
|
|
@ -61,7 +65,7 @@ const check = (name, ok, detail) => {
|
|||
const BASE = `http://127.0.0.1:${PORT}`;
|
||||
const logFile = path.join(os.tmpdir(), 'st-smoke.log');
|
||||
const srv = spawn('node', ['server.js'], {
|
||||
cwd: path.join(__dirname, '..', '..'),
|
||||
cwd: __dirname,
|
||||
env: { ...process.env, DATA_DIR, SELF_HOSTED: 'true', PORT: String(PORT), NODE_ENV: 'production' },
|
||||
stdio: ['ignore', fs.openSync(logFile, 'w'), fs.openSync(logFile, 'a')],
|
||||
});
|
||||
Loading…
Reference in a new issue