-
-
Notifications
You must be signed in to change notification settings - Fork 35.4k
Expand file tree
/
Copy pathtest-runner-cli-args.js
More file actions
47 lines (38 loc) · 1.38 KB
/
test-runner-cli-args.js
File metadata and controls
47 lines (38 loc) · 1.38 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
'use strict';
require('../common');
const assert = require('assert');
const { spawnSync } = require('child_process');
const fixtures = require('../common/fixtures');
const testFixture = fixtures.path('test-runner/argv.js');
{
const args = ['--test', testFixture, '--hello'];
const child = spawnSync(process.execPath, args);
assert.strictEqual(child.stderr.toString(), '');
const stdout = child.stdout.toString();
assert.match(stdout, /"--hello"\]/);
assert.strictEqual(child.status, 0);
}
{
const args = ['--test', testFixture, '--', '--hello', '--world'];
const child = spawnSync(process.execPath, args);
assert.strictEqual(child.stderr.toString(), '');
const stdout = child.stdout.toString();
assert.match(stdout, /"--","--hello","--world"\]/);
assert.strictEqual(child.status, 0);
}
{
const args = ['--test', testFixture, '--', 'foo.js'];
const child = spawnSync(process.execPath, args);
assert.strictEqual(child.stderr.toString(), '');
const stdout = child.stdout.toString();
assert.match(stdout, /"--","foo\.js"\]/);
assert.strictEqual(child.status, 0);
}
{
const args = ['--test', testFixture, '--hello', '--', 'world'];
const child = spawnSync(process.execPath, args);
assert.strictEqual(child.stderr.toString(), '');
const stdout = child.stdout.toString();
assert.match(stdout, /"--hello","--","world"\]/);
assert.strictEqual(child.status, 0);
}