Skip to content

Commit acce8f7

Browse files
committed
fix lint
1 parent bcdc12d commit acce8f7

File tree

7 files changed

+49
-85
lines changed

7 files changed

+49
-85
lines changed

.github/workflows/release.yml

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ jobs:
2525
# setting a registry enables the NODE_AUTH_TOKEN env variable where we can set an npm token. REQUIRED
2626
registry-url: 'https://registry.npmjs.org'
2727
- run: npm i
28-
- run: npm test
2928
- name: npm version && npm publish
3029
uses: bcomnes/[email protected]
3130
with:

package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@
2525
"test": "nyc npm run _mocha",
2626
"watch": "npm run _mocha -- --watch --growl",
2727
"codecov": "nyc report -r lcovonly && codecov",
28-
"prepublishOnly": "git push --follow-tags && gh-release -y",
29-
"version": "auto-changelog -p --template keepachangelog auto-changelog --breaking-pattern 'BREAKING CHANGE:' && git add CHANGELOG.md"
28+
"version": "auto-changelog -p --template keepachangelog auto-changelog --breaking-pattern 'BREAKING CHANGE:' && git add CHANGELOG.md",
29+
"preversion": "npm test",
30+
"postversion": "git push --follow-tags && gh-release -y"
3031
},
3132
"dependencies": {
3233
"ansi-styles": "^4.2.1",

test/argument-placeholders.js

+35-70
Original file line numberDiff line numberDiff line change
@@ -31,191 +31,156 @@ describe("[argument-placeholders]", () => {
3131
describe("If arguments preceded by '--' are nothing, '{1}' should be empty:", () => {
3232
it("Node API", () =>
3333
nodeApi("test-task:dump {1}")
34-
.then(() => assert(result() === "[]"))
35-
)
34+
.then(() => assert(result() === "[]")))
3635

3736
it("npm-run-all command", () =>
3837
runAll(["test-task:dump {1}"])
39-
.then(() => assert(result() === "[]"))
40-
)
38+
.then(() => assert(result() === "[]")))
4139

4240
it("npm-run-all command (only '--' exists)", () =>
4341
runAll(["test-task:dump {1}", "--"])
44-
.then(() => assert(result() === "[]"))
45-
)
42+
.then(() => assert(result() === "[]")))
4643

4744
it("run-s command", () =>
4845
runSeq(["test-task:dump {1}"])
49-
.then(() => assert(result() === "[]"))
50-
)
46+
.then(() => assert(result() === "[]")))
5147

5248
it("run-s command (only '--' exists)", () =>
5349
runSeq(["test-task:dump {1}", "--"])
54-
.then(() => assert(result() === "[]"))
55-
)
50+
.then(() => assert(result() === "[]")))
5651

5752
it("run-p command", () =>
5853
runPar(["test-task:dump {1}"])
59-
.then(() => assert(result() === "[]"))
60-
)
54+
.then(() => assert(result() === "[]")))
6155

6256
it("run-p command (only '--' exists)", () =>
6357
runPar(["test-task:dump {1}", "--"])
64-
.then(() => assert(result() === "[]"))
65-
)
58+
.then(() => assert(result() === "[]")))
6659
})
6760

6861
describe("'{1}' should be replaced by the 1st argument preceded by '--':", () => {
6962
it("Node API", () =>
7063
nodeApi("test-task:dump {1}", { arguments: ["1st", "2nd"] })
71-
.then(() => assert(result() === "[\"1st\"]"))
72-
)
64+
.then(() => assert(result() === "[\"1st\"]")))
7365

7466
it("npm-run-all command", () =>
7567
runAll(["test-task:dump {1}", "--", "1st", "2nd"])
76-
.then(() => assert(result() === "[\"1st\"]"))
77-
)
68+
.then(() => assert(result() === "[\"1st\"]")))
7869

7970
it("run-s command", () =>
8071
runSeq(["test-task:dump {1}", "--", "1st", "2nd"])
81-
.then(() => assert(result() === "[\"1st\"]"))
82-
)
72+
.then(() => assert(result() === "[\"1st\"]")))
8373

8474
it("run-p command", () =>
8575
runPar(["test-task:dump {1}", "--", "1st", "2nd"])
86-
.then(() => assert(result() === "[\"1st\"]"))
87-
)
76+
.then(() => assert(result() === "[\"1st\"]")))
8877
})
8978

9079
describe("'{2}' should be replaced by the 2nd argument preceded by '--':", () => {
9180
it("Node API", () =>
9281
nodeApi("test-task:dump {2}", { arguments: ["1st", "2nd"] })
93-
.then(() => assert(result() === "[\"2nd\"]"))
94-
)
82+
.then(() => assert(result() === "[\"2nd\"]")))
9583

9684
it("npm-run-all command", () =>
9785
runAll(["test-task:dump {2}", "--", "1st", "2nd"])
98-
.then(() => assert(result() === "[\"2nd\"]"))
99-
)
86+
.then(() => assert(result() === "[\"2nd\"]")))
10087

10188
it("run-s command", () =>
10289
runSeq(["test-task:dump {2}", "--", "1st", "2nd"])
103-
.then(() => assert(result() === "[\"2nd\"]"))
104-
)
90+
.then(() => assert(result() === "[\"2nd\"]")))
10591

10692
it("run-p command", () =>
10793
runPar(["test-task:dump {2}", "--", "1st", "2nd"])
108-
.then(() => assert(result() === "[\"2nd\"]"))
109-
)
94+
.then(() => assert(result() === "[\"2nd\"]")))
11095
})
11196

11297
describe("'{@}' should be replaced by the every argument preceded by '--':", () => {
11398
it("Node API", () =>
11499
nodeApi("test-task:dump {@}", { arguments: ["1st", "2nd"] })
115-
.then(() => assert(result() === "[\"1st\",\"2nd\"]"))
116-
)
100+
.then(() => assert(result() === "[\"1st\",\"2nd\"]")))
117101

118102
it("npm-run-all command", () =>
119103
runAll(["test-task:dump {@}", "--", "1st", "2nd"])
120-
.then(() => assert(result() === "[\"1st\",\"2nd\"]"))
121-
)
104+
.then(() => assert(result() === "[\"1st\",\"2nd\"]")))
122105

123106
it("run-s command", () =>
124107
runSeq(["test-task:dump {@}", "--", "1st", "2nd"])
125-
.then(() => assert(result() === "[\"1st\",\"2nd\"]"))
126-
)
108+
.then(() => assert(result() === "[\"1st\",\"2nd\"]")))
127109

128110
it("run-p command", () =>
129111
runPar(["test-task:dump {@}", "--", "1st", "2nd"])
130-
.then(() => assert(result() === "[\"1st\",\"2nd\"]"))
131-
)
112+
.then(() => assert(result() === "[\"1st\",\"2nd\"]")))
132113
})
133114

134115
describe("'{*}' should be replaced by the all arguments preceded by '--':", () => {
135116
it("Node API", () =>
136117
nodeApi("test-task:dump {*}", { arguments: ["1st", "2nd"] })
137-
.then(() => assert(result() === "[\"1st 2nd\"]"))
138-
)
118+
.then(() => assert(result() === "[\"1st 2nd\"]")))
139119

140120
it("npm-run-all command", () =>
141121
runAll(["test-task:dump {*}", "--", "1st", "2nd"])
142-
.then(() => assert(result() === "[\"1st 2nd\"]"))
143-
)
122+
.then(() => assert(result() === "[\"1st 2nd\"]")))
144123

145124
it("run-s command", () =>
146125
runSeq(["test-task:dump {*}", "--", "1st", "2nd"])
147-
.then(() => assert(result() === "[\"1st 2nd\"]"))
148-
)
126+
.then(() => assert(result() === "[\"1st 2nd\"]")))
149127

150128
it("run-p command", () =>
151129
runPar(["test-task:dump {*}", "--", "1st", "2nd"])
152-
.then(() => assert(result() === "[\"1st 2nd\"]"))
153-
)
130+
.then(() => assert(result() === "[\"1st 2nd\"]")))
154131
})
155132

156133
describe("Every '{1}', '{2}', '{@}' and '{*}' should be replaced by the arguments preceded by '--':", () => {
157134
it("Node API", () =>
158135
nodeApi("test-task:dump {1} {2} {3} {@} {*}", { arguments: ["1st", "2nd"] })
159-
.then(() => assert(result() === "[\"1st\",\"2nd\",\"1st\",\"2nd\",\"1st 2nd\"]"))
160-
)
136+
.then(() => assert(result() === "[\"1st\",\"2nd\",\"1st\",\"2nd\",\"1st 2nd\"]")))
161137

162138
it("npm-run-all command", () =>
163139
runAll(["test-task:dump {1} {2} {3} {@} {*}", "--", "1st", "2nd"])
164-
.then(() => assert(result() === "[\"1st\",\"2nd\",\"1st\",\"2nd\",\"1st 2nd\"]"))
165-
)
140+
.then(() => assert(result() === "[\"1st\",\"2nd\",\"1st\",\"2nd\",\"1st 2nd\"]")))
166141

167142
it("run-s command", () =>
168143
runSeq(["test-task:dump {1} {2} {3} {@} {*}", "--", "1st", "2nd"])
169-
.then(() => assert(result() === "[\"1st\",\"2nd\",\"1st\",\"2nd\",\"1st 2nd\"]"))
170-
)
144+
.then(() => assert(result() === "[\"1st\",\"2nd\",\"1st\",\"2nd\",\"1st 2nd\"]")))
171145

172146
it("run-p command", () =>
173147
runPar(["test-task:dump {1} {2} {3} {@} {*}", "--", "1st", "2nd"])
174-
.then(() => assert(result() === "[\"1st\",\"2nd\",\"1st\",\"2nd\",\"1st 2nd\"]"))
175-
)
148+
.then(() => assert(result() === "[\"1st\",\"2nd\",\"1st\",\"2nd\",\"1st 2nd\"]")))
176149
})
177150

178151
describe("'{1:-foo}' should be replaced by 'foo' if arguments are nothing:", () => {
179152
it("Node API", () =>
180153
nodeApi("test-task:dump {1:-foo} {1}")
181-
.then(() => assert(result() === "[\"foo\"]"))
182-
)
154+
.then(() => assert(result() === "[\"foo\"]")))
183155

184156
it("npm-run-all command", () =>
185157
runAll(["test-task:dump {1:-foo} {1}"])
186-
.then(() => assert(result() === "[\"foo\"]"))
187-
)
158+
.then(() => assert(result() === "[\"foo\"]")))
188159

189160
it("run-s command", () =>
190161
runSeq(["test-task:dump {1:-foo} {1}"])
191-
.then(() => assert(result() === "[\"foo\"]"))
192-
)
162+
.then(() => assert(result() === "[\"foo\"]")))
193163

194164
it("run-p command", () =>
195165
runPar(["test-task:dump {1:-foo} {1}"])
196-
.then(() => assert(result() === "[\"foo\"]"))
197-
)
166+
.then(() => assert(result() === "[\"foo\"]")))
198167
})
199168

200169
describe("'{1:=foo}' should be replaced by 'foo' and should affect following '{1}' if arguments are nothing:", () => {
201170
it("Node API", () =>
202171
nodeApi("test-task:dump {1:=foo} {1}")
203-
.then(() => assert(result() === "[\"foo\",\"foo\"]"))
204-
)
172+
.then(() => assert(result() === "[\"foo\",\"foo\"]")))
205173

206174
it("npm-run-all command", () =>
207175
runAll(["test-task:dump {1:=foo} {1}"])
208-
.then(() => assert(result() === "[\"foo\",\"foo\"]"))
209-
)
176+
.then(() => assert(result() === "[\"foo\",\"foo\"]")))
210177

211178
it("run-s command", () =>
212179
runSeq(["test-task:dump {1:=foo} {1}"])
213-
.then(() => assert(result() === "[\"foo\",\"foo\"]"))
214-
)
180+
.then(() => assert(result() === "[\"foo\",\"foo\"]")))
215181

216182
it("run-p command", () =>
217183
runPar(["test-task:dump {1:=foo} {1}"])
218-
.then(() => assert(result() === "[\"foo\",\"foo\"]"))
219-
)
184+
.then(() => assert(result() === "[\"foo\",\"foo\"]")))
220185
})
221186
})

test/bin/run-tests.js

+3-5
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,9 @@
55
*/
66
"use strict"
77

8-
/*
9-
* Run tests in parallel.
10-
* This can reduce the spent time of tests to 1/3, but this is badly affecting to the timers in tests.
11-
* I need more investigation.
12-
*/
8+
// Run tests in parallel.
9+
// This can reduce the spent time of tests to 1/3, but this is badly affecting to the timers in tests.
10+
// I need more investigation.
1311

1412
//------------------------------------------------------------------------------
1513
// Requirements

test/fail.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,7 @@ describe("[fail] it should fail", () => {
108108
it("run-s command", () => shouldFail(runSeq(["test-task:abort"])))
109109
it("run-p command", () => shouldFail(runPar(["test-task:abort"])))
110110
it("with correct exit code", () => nodeApi("test-task:abort").then(() =>
111-
assert(false, "should fail")
112-
).catch(err => {
111+
assert(false, "should fail")).catch(err => {
113112
// In NodeJS versions > 6, the child process correctly sends back
114113
// the signal + code of null. In NodeJS versions <= 6, the child
115114
// process does not set the signal, and sets the code to 1.

test/mixed.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,5 @@ describe("[mixed] npm-run-all", () => {
5858
"-p", "test-task:append b", "test-task:append c",
5959
"-s", "test-task:append d", "test-task:append e",
6060
"-r",
61-
])
62-
)
61+
]))
6362
})

test/parallel.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ describe("[parallel]", () => {
4141
result() === "abab" ||
4242
result() === "baba" ||
4343
result() === "abba" ||
44-
result() === "baab")
44+
result() === "baab"
45+
)
4546
})
4647

4748
it("npm-run-all command", async () => {
@@ -50,7 +51,8 @@ describe("[parallel]", () => {
5051
result() === "abab" ||
5152
result() === "baba" ||
5253
result() === "abba" ||
53-
result() === "baab")
54+
result() === "baab"
55+
)
5456
})
5557

5658
it("run-p command", async () => {
@@ -59,7 +61,8 @@ describe("[parallel]", () => {
5961
result() === "abab" ||
6062
result() === "baba" ||
6163
result() === "abba" ||
62-
result() === "baab")
64+
result() === "baab"
65+
)
6366
})
6467
})
6568

0 commit comments

Comments
 (0)