forked from mysticatea/npm-run-all
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmixed.js
63 lines (55 loc) · 2.04 KB
/
mixed.js
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/**
* @author Toru Nagashima
* @copyright 2016 Toru Nagashima. All rights reserved.
* See LICENSE file in root directory for full license.
*/
"use strict"
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const assert = require("power-assert")
const util = require("./lib/util")
const result = util.result
const removeResult = util.removeResult
const runAll = util.runAll
//------------------------------------------------------------------------------
// Test
//------------------------------------------------------------------------------
describe("[mixed] npm-run-all", () => {
before(() => process.chdir("test-workspace"))
after(() => process.chdir(".."))
beforeEach(removeResult)
it("should run a mix of sequential and parallel tasks (has the default group):", async () => {
await runAll([
"test-task:append a",
"-p", "test-task:append b", "test-task:append c",
"-s", "test-task:append d", "test-task:append e",
])
assert(
result() === "aabcbcddee" ||
result() === "aabccbddee" ||
result() === "aacbbcddee" ||
result() === "aacbcbddee"
)
})
it("should run a mix of sequential and parallel tasks (doesn't have the default group):", async () => {
await runAll([
"-p", "test-task:append b", "test-task:append c",
"-s", "test-task:append d", "test-task:append e",
])
assert(
result() === "bcbcddee" ||
result() === "bccbddee" ||
result() === "cbbcddee" ||
result() === "cbcbddee"
)
})
it("should not throw errors for --race and --max-parallel options if --parallel exists:", () =>
runAll([
"test-task:append a",
"-p", "test-task:append b", "test-task:append c",
"-s", "test-task:append d", "test-task:append e",
"-r",
])
)
})