aboutsummaryrefslogtreecommitdiffstats
path: root/build/tasks/promises_aplus_tests.js
blob: d917b5848720a9d67699bb5891339fcd221bbd38 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
"use strict";

const { spawn } = require( "child_process" );
const verifyNodeVersion = require( "./lib/verifyNodeVersion" );
const path = require( "path" );
const os = require( "os" );

if ( !verifyNodeVersion() ) {
	return;
}

const command = path.resolve(
	__dirname,
	`../../node_modules/.bin/promises-aplus-tests${ os.platform() === "win32" ? ".cmd" : "" }`
);
const args = [ "--reporter", "dot", "--timeout", "2000" ];
const tests = [
	"test/promises_aplus_adapters/deferred.cjs",
	"test/promises_aplus_adapters/when.cjs"
];

async function runTests() {
	tests.forEach( ( test ) => {
		spawn(
			command,
			[ test ].concat( args ),
			{ stdio: "inherit" }
		);
	} );
}

runTests();