77 */
88import * as SDKTypes from "./types.js" ;
99import * 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';
690691const THIS_SOURCE_FILE = 'src/spec.types.test.ts' ;
691692
692693describe ( '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' ) ;
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