forked from izu/student-web-if-development-kit
18 lines
774 B
JavaScript
18 lines
774 B
JavaScript
import test from 'node:test';
|
|
import assert from 'node:assert/strict';
|
|
import { readFileSync } from 'node:fs';
|
|
|
|
const indexHtml = readFileSync(new URL('../index.html', import.meta.url), 'utf8');
|
|
const viewerHtml = readFileSync(new URL('../viewer.html', import.meta.url), 'utf8');
|
|
|
|
test('Tapops index uses module scripts and no inline behavior', () => {
|
|
assert.match(indexHtml, /<script type="module" src="js\/app\.js"><\/script>/);
|
|
assert.doesNotMatch(indexHtml, /<script>\s*\(/);
|
|
assert.doesNotMatch(indexHtml, /\sonclick=/);
|
|
});
|
|
|
|
test('Tapops viewer uses module scripts and no inline behavior', () => {
|
|
assert.match(viewerHtml, /<script type="module" src="js\/viewer\/viewer-app\.js"><\/script>/);
|
|
assert.doesNotMatch(viewerHtml, /<script>\s*\(/);
|
|
});
|