11import path from "node:path" ;
2- import { test , type TestContext } from "node:test" ;
2+ import { test } from "node:test" ;
33
44import { listDirectoryEntries , runFileInSubprocess } from "./tests.ts" ;
55
@@ -19,31 +19,21 @@ const LOAD_ADDON_MODULE_PATH = path.join(
1919 "load-addon.js"
2020) ;
2121
22- async function populateSuite (
23- testContext : TestContext ,
22+
23+ function populateSuite (
2424 dir : string
25- ) : Promise < void > {
25+ ) {
2626 const { directories, files } = listDirectoryEntries ( dir ) ;
2727
2828 for ( const file of files ) {
29- await testContext . test ( file , ( ) => runFileInSubprocess ( dir , file ) ) ;
29+ test ( path . relative ( TESTS_ROOT_PATH , path . join ( dir , file ) ) , ( ) => runFileInSubprocess ( dir , file ) ) ;
3030 }
3131
3232 for ( const directory of directories ) {
33- await testContext . test ( directory , async ( subTest ) => {
34- await populateSuite ( subTest , path . join ( dir , directory ) ) ;
35- } ) ;
33+ populateSuite ( path . join ( dir , directory ) ) ;
3634 }
3735}
3836
39- test ( "harness" , async ( t ) => {
40- await populateSuite ( t , path . join ( TESTS_ROOT_PATH , "harness" ) ) ;
41- } ) ;
42-
43- test ( "js-native-api" , async ( t ) => {
44- await populateSuite ( t , path . join ( TESTS_ROOT_PATH , "js-native-api" ) ) ;
45- } ) ;
46-
47- test ( "node-api" , async ( t ) => {
48- await populateSuite ( t , path . join ( TESTS_ROOT_PATH , "node-api" ) ) ;
49- } ) ;
37+ populateSuite ( path . join ( TESTS_ROOT_PATH , "harness" ) ) ;
38+ populateSuite ( path . join ( TESTS_ROOT_PATH , "js-native-api" ) ) ;
39+ populateSuite ( path . join ( TESTS_ROOT_PATH , "node-api" ) ) ;
0 commit comments