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-20 22:18:42 +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-20 22:18:42 +00:00
|
|
|
if ( !verifyNodeVersion() ) {
|
|
|
|
return;
|
|
|
|
}
|
2016-04-15 03:59:30 +00:00
|
|
|
|
2023-09-20 22:18:42 +00:00
|
|
|
const command = path.resolve(
|
|
|
|
__dirname,
|
2023-11-01 23:48:05 +00:00
|
|
|
`../../node_modules/.bin/promises-aplus-tests${ os.platform() === "win32" ? ".cmd" : "" }`
|
2023-09-20 22:18:42 +00:00
|
|
|
);
|
|
|
|
const args = [ "--reporter", "dot", "--timeout", "2000" ];
|
|
|
|
const tests = [
|
|
|
|
"test/promises_aplus_adapters/deferred.js",
|
|
|
|
"test/promises_aplus_adapters/when.js"
|
|
|
|
];
|
2016-04-15 03:59:30 +00:00
|
|
|
|
2023-09-20 22:18:42 +00:00
|
|
|
async function runTests() {
|
|
|
|
tests.forEach( ( test ) => {
|
|
|
|
spawn(
|
|
|
|
command,
|
|
|
|
[ test ].concat( args ),
|
2024-06-15 13:10:59 +00:00
|
|
|
{ shell: true, stdio: "inherit" }
|
2015-04-26 17:33:05 +00:00
|
|
|
);
|
|
|
|
} );
|
2023-09-20 22:18:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
runTests();
|