Skip to content

Commit a19175a

Browse files
committed
Update spec.types.test.ts
1 parent 0cd88db commit a19175a

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

src/spec.types.test.ts

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
*/
88
import * as SDKTypes from "./types.js";
99
import * as SpecTypes from "./spec.types.js";
10+
import fs from "node:fs";
1011

1112
/* eslint-disable @typescript-eslint/no-unused-vars */
1213
/* eslint-disable @typescript-eslint/no-unsafe-function-type */
@@ -690,18 +691,18 @@ const SPEC_TYPES_FILE = 'src/spec.types.ts';
690691
const THIS_SOURCE_FILE = 'src/spec.types.test.ts';
691692

692693
describe('Spec Types', () => {
693-
const specTypesContent = require('fs').readFileSync(SPEC_TYPES_FILE, 'utf-8');
694-
const typeNames = [...specTypesContent.matchAll(/export\s+interface\s+(\w+)\b/g)].map(m => m[1]);
695-
const testContent = require('fs').readFileSync(THIS_SOURCE_FILE, 'utf-8');
694+
const specTypesContent = fs.readFileSync(SPEC_TYPES_FILE, 'utf-8');
695+
const typeNames = [...specTypesContent.matchAll(/export\s+interface\s+(\w+)\b/g)].map(m => m[1]);
696+
const testContent = fs.readFileSync(THIS_SOURCE_FILE, 'utf-8');
696697

697-
it('should define some expected types', () => {
698-
expect(typeNames).toContain('JSONRPCNotification');
699-
expect(typeNames).toContain('ElicitResult');
700-
});
698+
it('should define some expected types', () => {
699+
expect(typeNames).toContain('JSONRPCNotification');
700+
expect(typeNames).toContain('ElicitResult');
701+
});
701702

702-
for (const typeName of typeNames) {
703-
it(`${typeName} should have a compatibility test`, () => {
704-
expect(testContent).toContain(`function check${typeName}(`);
705-
});
706-
}
703+
for (const typeName of typeNames) {
704+
it(`${typeName} should have a compatibility test`, () => {
705+
expect(testContent).toContain(`function check${typeName}(`);
706+
});
707+
}
707708
});

0 commit comments

Comments
 (0)