mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-03 01:28:55 +00:00
refactor(plugins): generate SDK egress policy from the server
This commit is contained in:
@@ -46,14 +46,9 @@ describe.skipIf(!inMonorepo)('parity with the host', () => {
|
||||
});
|
||||
|
||||
it('the vendored egress-policy helpers are byte-identical to the server\'s', () => {
|
||||
const ours = fs.readFileSync(path.resolve(here, '../src/egress-policy.ts'), 'utf8').replace(/\r\n/g, '\n');
|
||||
const ours = fs.readFileSync(path.resolve(here, '../src/generated/egress-policy.ts'), 'utf8').replace(/\r\n/g, '\n');
|
||||
const theirs = fs.readFileSync(serverEgress, 'utf8').replace(/\r\n/g, '\n');
|
||||
const marker = 'const apply = Reflect.apply;';
|
||||
const end = '// ---------------------------------------------------------------------------\n// The dev-server guard.';
|
||||
expect(ours.indexOf(marker)).toBeGreaterThan(-1);
|
||||
expect(ours.indexOf(end)).toBeGreaterThan(ours.indexOf(marker));
|
||||
expect(theirs.indexOf(marker)).toBeGreaterThan(-1);
|
||||
expect(ours.slice(ours.indexOf(marker), ours.indexOf(end)).trim()).toBe(theirs.slice(theirs.indexOf(marker)).trim());
|
||||
expect(ours).toBe(theirs);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user