Files
lab-console-busybox/tests/card_contract.test.mjs
T

6 lines
900 B
JavaScript

import assert from 'node:assert/strict'; import { access, readFile } from 'node:fs/promises'; import test from 'node:test';
const source=JSON.parse(await readFile(new URL('../json/card_source.json',import.meta.url),'utf8'));
test('L01 identity and task order are stable',()=>{assert.equal(source.card.number,'01');assert.equal(source.card.uuid,'2fc78af3-5711-5e91-a282-acf442d46139');assert.deepEqual(source.tasks_order,['task01','task02','task03']);});
test('multicall evidence and explicit fixture boundary are present',()=>{const text=JSON.stringify(source);for(const token of ['multicall','fixture','symlink','hostname','trace.log'])assert.match(text,new RegExp(token,'i'));});
test('all executable task sources exist',async()=>{for(const name of ['task01_multicall_dispatch','task02_files_and_text','task03_process_and_host'])await access(new URL(`../src/tasks/${name}.sh`,import.meta.url));});