config loads without Node's MODULE_TYPELESS_PACKAGE_JSON warning in a CommonJS project; capture sign-in docs use captureAuth and check notes a local capture that signs in with reviewDemoAccount (the App Review account)

This commit is contained in:
CRTkafa 2026-10-20 13:11:10 +07:00
parent 2fdd96e68c
commit 8c1a01d856
5 changed files with 38 additions and 5 deletions

View file

@ -0,0 +1,15 @@
// The App Review demo account (reviewDemoAccount, sent by apple review-details) must work on the live backend: a
// capture sign-in against a local stack that uses it gets a check note (a session nearly stored local-only creds there).
import { afterEach, expect, test } from 'bun:test';
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 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 () => {
expect(await notes(withAuth('http://localhost:5173', 'reviewDemoAccount.username'))).toContain('captureAuth');
expect(await notes(withAuth('http://localhost:5173', 'email'))).not.toContain('signs in to a local stack');
expect(await notes(withAuth('https://staging.example.com', 'reviewDemoAccount.username'))).not.toContain('signs in to a local stack');
});