mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-15 15:52:21 +00:00
Every scenario runs through scripts/qa-strict-harness.mjs: each page, frame and worker gets an ordered block list before it runs (paid hosts and routes first, then only the preview, declared fixtures, keyless probes and cached free tile hosts), switches with real input on the picker, and records its assertions per layer and engine. The runner reads the catalog from the live page, fails any layer without an assertion on either engine, can build and serve a keyless checkout itself, and adds rapid, hidden-tab, context-loss, failure-injection, cold-chunk and soak scenarios. The main chunk gets a 1% size budget.
48 lines
1.1 KiB
JavaScript
48 lines
1.1 KiB
JavaScript
import test from 'node:test';
|
|
import assert from 'node:assert/strict';
|
|
import { quantile, slope } from './qa-strict-session.mjs';
|
|
import { strictArguments } from './qa-strict-harness.mjs';
|
|
|
|
test('slope is the least-squares growth per step', () => {
|
|
assert.equal(slope([[0, 5]]), 0);
|
|
assert.equal(
|
|
slope([
|
|
[20, 100],
|
|
[50, 103],
|
|
[100, 108],
|
|
]).toFixed(3),
|
|
'0.100',
|
|
);
|
|
assert.equal(
|
|
slope([
|
|
[1, 7],
|
|
[2, 7],
|
|
[3, 7],
|
|
]),
|
|
0,
|
|
);
|
|
});
|
|
|
|
test('quantile takes the nearest rank', () => {
|
|
assert.equal(quantile([], 0.5), null);
|
|
assert.equal(quantile([5, 1, 3, 2, 4], 0.5), 3);
|
|
assert.equal(
|
|
quantile(
|
|
[...Array(100)].map((_, i) => i + 1),
|
|
0.95,
|
|
),
|
|
95,
|
|
);
|
|
});
|
|
|
|
test('the runner hands each scenario its layers and its manifest path', () => {
|
|
assert.deepEqual(
|
|
strictArguments(['node', 'x', '--layers=a,b', '--evidence=/tmp/e.json']),
|
|
{ layers: ['a', 'b'], evidence: '/tmp/e.json' },
|
|
);
|
|
assert.deepEqual(strictArguments(['node', 'x', '--layers=']), {
|
|
layers: null,
|
|
evidence: process.env.QA_STRICT_EVIDENCE ?? null,
|
|
});
|
|
});
|