7
7
*/
8
8
import * as SDKTypes from "./types.js" ;
9
9
import * as SpecTypes from "./spec.types.js" ;
10
+ import fs from "node:fs" ;
10
11
11
12
/* eslint-disable @typescript-eslint/no-unused-vars */
12
13
/* eslint-disable @typescript-eslint/no-unsafe-function-type */
@@ -690,18 +691,18 @@ const SPEC_TYPES_FILE = 'src/spec.types.ts';
690
691
const THIS_SOURCE_FILE = 'src/spec.types.test.ts' ;
691
692
692
693
describe ( 'Spec Types' , ( ) => {
693
- const specTypesContent = require ( 'fs' ) . readFileSync ( SPEC_TYPES_FILE , 'utf-8' ) ;
694
- const typeNames = [ ...specTypesContent . matchAll ( / e x p o r t \s + i n t e r f a c e \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 ( / e x p o r t \s + i n t e r f a c e \s + ( \w + ) \b / g) ] . map ( m => m [ 1 ] ) ;
696
+ const testContent = fs . readFileSync ( THIS_SOURCE_FILE , 'utf-8' ) ;
696
697
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
+ } ) ;
701
702
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
+ }
707
708
} ) ;
0 commit comments