Refractoring Stage 6.6 Migrated productivity.js and shortcuts.js mail-state access and render/preferences hooks to the mail feature API.
This commit is contained in:
@@ -2,6 +2,7 @@ const test = require('node:test');
|
||||
const assert = require('node:assert/strict');
|
||||
const fs = require('node:fs');
|
||||
const path = require('node:path');
|
||||
const vm = require('node:vm');
|
||||
|
||||
const root = path.resolve(__dirname, '..');
|
||||
const read = file => fs.readFileSync(path.join(root, file), 'utf8');
|
||||
@@ -27,3 +28,10 @@ test('desktop, Android web generation, and offline cache include renderer suppor
|
||||
assert.ok(worker.includes(`'./${file}'`), `service worker is missing ${file}`);
|
||||
}
|
||||
});
|
||||
|
||||
test('classic renderer scripts have no duplicate global lexical declarations', () => {
|
||||
const html = read('index.html');
|
||||
const scripts = [...html.matchAll(/<script src="([^"]+)"/g)].map(match => match[1]);
|
||||
const source = scripts.map(script => read(script)).join('\n');
|
||||
assert.doesNotThrow(() => new vm.Script(source, { filename: 'renderer-classic-scripts.js' }));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user