shots: Playwright's chromium is taken from the namespace or default of a project's CommonJS playwright; a module without chromium.launch names the resolved file and its exports (a project's playwright 1.57 under a global Bun install gave 'reading launch of undefined'); tests: the review-account fixture typechecks

This commit is contained in:
CRTkafa 2026-10-20 13:44:22 +07:00
parent ac84ad4bbf
commit 353e13d5be
4 changed files with 43 additions and 3 deletions

View file

@ -5,7 +5,7 @@ import { run as check } from '../cli/check';
import { BASE, capture, jsonOut, project, restore } from './helpers/store-mock';
afterEach(restore);
const withAuth = (baseUrl: string, ref: string) => ({ ...BASE, play: undefined, shots: { capture: { baseUrl, auth: { request: { url: '/api/login', method: 'POST', body: { email: `\${cred:${ref}}`, password: `\${cred:${ref.replace('username', 'password').replace('email', 'password')}}` } } } } } }) as typeof BASE;
const withAuth = (baseUrl: string, ref: string) => ({ ...BASE, play: undefined, shots: { capture: { baseUrl, auth: { request: { url: '/api/login', method: 'POST', body: { email: `\${cred:${ref}}`, password: `\${cred:${ref.replace('username', 'password').replace('email', 'password')}}` } } } } } }) as unknown as typeof BASE;
const notes = async (cfg: typeof BASE) => { const p = project(cfg, { '.gitignore': '.storebound/\n' }); const j = jsonOut((await capture(() => check(p.ctx(['--json'], ['json'])))).out); return JSON.stringify(j); };
test('local capture with reviewDemoAccount gets a note; captureAuth or a remote stack does not', async () => {