2019-03-11 15:06:17 +00:00
|
|
|
"use strict";
|
2015-04-26 17:33:05 +00:00
|
|
|
|
2024-03-10 16:19:15 +00:00
|
|
|
const { spawn } = require( "node:child_process" );
|
2023-09-18 16:39:00 +00:00
|
|
|
const verifyNodeVersion = require( "./lib/verifyNodeVersion" );
|
2024-03-10 16:19:15 +00:00
|
|
|
const path = require( "node:path" );
|
|
|
|
const os = require( "node:os" );
|
2015-04-26 17:33:05 +00:00
|
|
|
|
2023-09-18 16:39:00 +00:00
|
|
|
if ( !verifyNodeVersion() ) {
|
|
|
|
return;
|
|
|
|
}
|
2016-04-15 03:59:30 +00:00
|
|
|
|
2023-09-18 16:39:00 +00:00
|
|
|
const command = path.resolve(
|
|
|
|
__dirname,
|
2023-11-01 23:48:50 +00:00
|
|
|
`../../node_modules/.bin/promises-aplus-tests${ os.platform() === "win32" ? ".cmd" : "" }`
|
2023-09-18 16:39:00 +00:00
|
|
|
);
|
|
|
|
const args = [ "--reporter", "dot", "--timeout", "2000" ];
|
|
|
|
const tests = [
|
|
|
|
"test/promises_aplus_adapters/deferred.cjs",
|
|
|
|
"test/promises_aplus_adapters/when.cjs"
|
|
|
|
];
|
2016-04-15 03:59:30 +00:00
|
|
|
|
2023-09-18 16:39:00 +00:00
|
|
|
async function runTests() {
|
|
|
|
tests.forEach( ( test ) => {
|
|
|
|
spawn(
|
|
|
|
command,
|
|
|
|
[ test ].concat( args ),
|
|
|
|
{ stdio: "inherit" }
|
2015-04-26 17:33:05 +00:00
|
|
|
);
|
|
|
|
} );
|
2023-09-18 16:39:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
runTests();
|