23 lines
910 B
JavaScript
23 lines
910 B
JavaScript
import test from 'node:test';
|
|
import assert from 'node:assert/strict';
|
|
import { readFileSync } from 'node:fs';
|
|
|
|
const root = new URL('../', import.meta.url);
|
|
const readProjectFile = (name) => readFileSync(new URL(name, root), 'utf8');
|
|
|
|
test('the playable shell uses a local canvas entry point and no external runtime assets', () => {
|
|
const html = readProjectFile('index.html');
|
|
|
|
assert.match(html, /<canvas[^>]+id="relay-canvas"/);
|
|
assert.match(html, /<script\s+type="module"\s+src="\.\/app\.js"><\/script>/);
|
|
assert.match(html, /data-action="anchor"/);
|
|
assert.doesNotMatch(html, /<(?:script|link|img)\b[^>]+(?:src|href)\s*=\s*["']https?:\/\//i);
|
|
});
|
|
|
|
test('the runtime exposes a narrow smoke-test surface without network calls', () => {
|
|
const app = readProjectFile('app.js');
|
|
|
|
assert.match(app, /window\.__VANTA_TEST__/);
|
|
assert.doesNotMatch(app, /\bfetch\s*\(|XMLHttpRequest|WebSocket/);
|
|
});
|