@@ -197,15 +197,22 @@ describe
197197 'TypeScript definitions' ,
198198 ( ) =>
199199 {
200- describe ( 'TypeScript 4.7' , ( ) => defineTests ( 'typescript_4.7' ) ) ;
201- describe ( 'TypeScript 4.8' , ( ) => defineTests ( 'typescript_4.8' ) ) ;
202- describe ( 'TypeScript 4.9' , ( ) => defineTests ( 'typescript_4.9' ) ) ;
203- describe ( 'TypeScript 5.0' , ( ) => defineTests ( 'typescript_5.0' ) ) ;
204- describe ( 'TypeScript 5.1' , ( ) => defineTests ( 'typescript_5.1' ) ) ;
205- describe ( 'TypeScript 5.2' , ( ) => defineTests ( 'typescript_5.2' ) ) ;
206- describe ( 'TypeScript 5.3' , ( ) => defineTests ( 'typescript_5.3' ) ) ;
207- describe ( 'TypeScript 5.4' , ( ) => defineTests ( 'typescript_5.4' ) ) ;
208- describe ( 'TypeScript 5.5' , ( ) => defineTests ( 'typescript_5.5' ) ) ;
209- describe ( 'TypeScript 5.6' , ( ) => defineTests ( 'typescript_5.6' ) ) ;
200+ const typescriptPkgNames =
201+ ( ( ) =>
202+ {
203+ const require = createRequire ( import . meta. url ) ;
204+ const { devDependencies } = require ( '../../package.json' ) ;
205+ const typescriptPkgNames =
206+ Object
207+ . keys ( devDependencies )
208+ . filter ( devDependency => / ^ t y p e s c r i p t _ \d + \. \d + $ / . test ( devDependency ) ) ;
209+ return typescriptPkgNames ;
210+ }
211+ ) ( ) ;
212+ for ( const typescriptPkgName of typescriptPkgNames )
213+ {
214+ const title = typescriptPkgName . replace ( / ^ t y p e s c r i p t _ / , 'TypeScript ' ) ;
215+ describe ( title , ( ) => defineTests ( typescriptPkgName ) ) ;
216+ }
210217 } ,
211218) ;
0 commit comments