Files
2026-07-21 18:20:10 +02:00

26 lines
1.0 KiB
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('L08 identity and task order are stable', () => {
assert.equal(source.card.number, '08');
assert.equal(source.card.uuid, 'b6d3b00d-6912-502d-95d7-3ee47c60f1db');
assert.deepEqual(source.tasks_order, ['task01', 'task02', 'task03']);
});
test('engine boundary and lifecycle are explicit', () => {
const text = JSON.stringify(source);
for (const token of ['offline-model', 'socket_exposed=0', 'build', 'running', 'exited', 'volume', 'bind', 'trace.log']) {
assert.match(text, new RegExp(token, 'i'));
}
assert.match(text, /nie oznacza uruchomienia prawdziwego silnika/i);
});
test('all task sources exist', async () => {
for (const name of ['task01_build_image_spec', 'task02_container_lifecycle', 'task03_volume_and_bind']) {
await access(new URL(`../src/tasks/${name}.sh`, import.meta.url));
}
});