18 lines
625 B
JavaScript
18 lines
625 B
JavaScript
const test = require('node:test');
|
|
const assert = require('node:assert/strict');
|
|
const fs = require('node:fs');
|
|
const path = require('node:path');
|
|
|
|
const ROOT = path.resolve(__dirname, '..');
|
|
|
|
test('index bootstraps state export runtime module', () => {
|
|
const html = fs.readFileSync(path.join(ROOT, 'index.html'), 'utf8');
|
|
assert.match(html, /js\/state-export\.js/);
|
|
});
|
|
|
|
test('engine tick writes state snapshots through the state export hook', () => {
|
|
const source = fs.readFileSync(path.join(ROOT, 'js', 'engine.js'), 'utf8');
|
|
assert.match(source, /StateExport/);
|
|
assert.match(source, /onTickBoundary\(G\)/);
|
|
});
|