Initial curated chimera source from a8ae5b1db07fb49926c94585e2718e5130330974
This commit is contained in:
commit
c737a37f71
531 files changed
+119270
No files matched your search
@@ -0,0 +1,19 @@
|
||||
'use strict';
|
||||
|
||||
const test = require('node:test');
|
||||
const assert = require('node:assert/strict');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
test('every literal web shim command has a registered server implementation', () => {
|
||||
const root = path.resolve(__dirname, '../..');
|
||||
const shim = fs.readFileSync(path.join(root, 'renderer', 'pork-web-shim.js'), 'utf8');
|
||||
const invoked = new Set([...shim.matchAll(/\binvoke\(\s*['"]([^'"]+)['"]/g)].map(match => match[1]));
|
||||
const registrySources = [
|
||||
path.join(root, 'src', 'server', 'create-registry.js'),
|
||||
path.join(root, 'src', 'server', 'register-functional-modules.js'),
|
||||
].map(file => fs.readFileSync(file, 'utf8')).join('\n');
|
||||
const registered = new Set([...registrySources.matchAll(/\bname:\s*['"]([^'"]+)['"]/g)].map(match => match[1]));
|
||||
const missing = [...invoked].filter(command => !registered.has(command)).sort();
|
||||
assert.deepEqual(missing, []);
|
||||
});
|
||||
Reference in new issue
Block a user