Skip to content
This repository was archived by the owner on Nov 8, 2024. It is now read-only.

Commit a8f1be7

Browse files
author
michalholasek
committed
chore: Remove unnecessary returns
1 parent a2e0e53 commit a8f1be7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+722
-722
lines changed

test/integration/child-process-test.js

+19-19
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,10 @@ describe('Babysitting Child Processes', () => {
8484
it('gets killed', () => assert.equal(processInfo.signal, 'SIGKILL'));
8585
it('returns no status code', () => assert.isNull(processInfo.exitStatus));
8686
}
87-
return it('does not emit an error', () => assert.isUndefined(processInfo.error));
87+
it('does not emit an error', () => assert.isUndefined(processInfo.error));
8888
});
8989

90-
return describe('process without support for graceful termination', () => {
90+
describe('process without support for graceful termination', () => {
9191
let processInfo;
9292

9393
before(done =>
@@ -107,7 +107,7 @@ describe('Babysitting Child Processes', () => {
107107
it('gets killed', () => assert.equal(processInfo.signal, 'SIGKILL'));
108108
it('returns no status code', () => assert.isNull(processInfo.exitStatus));
109109
}
110-
return it('does not emit an error', () => assert.isUndefined(processInfo.error));
110+
it('does not emit an error', () => assert.isUndefined(processInfo.error));
111111
});
112112
});
113113

@@ -131,10 +131,10 @@ describe('Babysitting Child Processes', () => {
131131
it('does not get terminated directly by the signal', () => assert.isNull(processInfo.signal));
132132
}
133133
it('returns zero status code', () => assert.equal(processInfo.exitStatus, 0));
134-
return it('does not emit an error', () => assert.isUndefined(processInfo.error));
134+
it('does not emit an error', () => assert.isUndefined(processInfo.error));
135135
});
136136

137-
return describe('process without support for graceful termination', () => {
137+
describe('process without support for graceful termination', () => {
138138
let processInfo;
139139

140140
before(done =>
@@ -150,7 +150,7 @@ describe('Babysitting Child Processes', () => {
150150
it('does not get terminated', () => assert.isFalse(processInfo.terminated));
151151
it('has undefined status code', () => assert.isUndefined(processInfo.exitStatus));
152152
it('emits an error', () => assert.instanceOf(processInfo.error, Error));
153-
return it('the error has a message about unsuccessful termination', () =>
153+
it('the error has a message about unsuccessful termination', () =>
154154
assert.equal(
155155
processInfo.error.message,
156156
`Unable to gracefully terminate process ${processInfo.childProcess.pid}`
@@ -179,10 +179,10 @@ describe('Babysitting Child Processes', () => {
179179
it('does not get terminated directly by the signal', () => assert.isNull(processInfo.signal));
180180
}
181181
it('returns zero status code', () => assert.equal(processInfo.exitStatus, 0));
182-
return it('does not emit an error', () => assert.isUndefined(processInfo.error));
182+
it('does not emit an error', () => assert.isUndefined(processInfo.error));
183183
});
184184

185-
return describe('process without support for graceful termination', () => {
185+
describe('process without support for graceful termination', () => {
186186
let processInfo;
187187

188188
before(done =>
@@ -204,11 +204,11 @@ describe('Babysitting Child Processes', () => {
204204
it('gets killed', () => assert.equal(processInfo.signal, 'SIGKILL'));
205205
it('returns no status code', () => assert.isNull(processInfo.exitStatus));
206206
}
207-
return it('does not emit an error', () => assert.isUndefined(processInfo.error));
207+
it('does not emit an error', () => assert.isUndefined(processInfo.error));
208208
});
209209
});
210210

211-
return describe('when child process terminates', () => {
211+
describe('when child process terminates', () => {
212212
describe('normally with zero status code', () => {
213213
let processInfo;
214214

@@ -225,7 +225,7 @@ describe('Babysitting Child Processes', () => {
225225
it('does not emit the \'crash\' event', () => assert.isFalse(processInfo.onCrash.called));
226226
it('is flagged as terminated', () => assert.isTrue(processInfo.childProcess.terminated));
227227
it('is not flagged as intentionally killed', () => assert.isFalse(processInfo.childProcess.killedIntentionally));
228-
return it('is not flagged as intentionally terminated', () => assert.isFalse(processInfo.childProcess.terminatedIntentionally));
228+
it('is not flagged as intentionally terminated', () => assert.isFalse(processInfo.childProcess.terminatedIntentionally));
229229
});
230230

231231
describe('normally with non-zero status code', () => {
@@ -246,7 +246,7 @@ describe('Babysitting Child Processes', () => {
246246
it('the \'crash\' event is not provided with killed flag', () => assert.isFalse(processInfo.onCrash.getCall(0).args[1]));
247247
it('is flagged as terminated', () => assert.isTrue(processInfo.childProcess.terminated));
248248
it('is not flagged as intentionally killed', () => assert.isFalse(processInfo.childProcess.killedIntentionally));
249-
return it('is not flagged as intentionally terminated', () => assert.isFalse(processInfo.childProcess.terminatedIntentionally));
249+
it('is not flagged as intentionally terminated', () => assert.isFalse(processInfo.childProcess.terminatedIntentionally));
250250
});
251251

252252
describe('intentionally gracefully with zero status code', () => {
@@ -265,7 +265,7 @@ describe('Babysitting Child Processes', () => {
265265
it('does not emit the \'crash\' event', () => assert.isFalse(processInfo.onCrash.called));
266266
it('is flagged as terminated', () => assert.isTrue(processInfo.childProcess.terminated));
267267
it('is not flagged as intentionally killed', () => assert.isFalse(processInfo.childProcess.killedIntentionally));
268-
return it('is flagged as intentionally terminated', () => assert.isTrue(processInfo.childProcess.terminatedIntentionally));
268+
it('is flagged as intentionally terminated', () => assert.isTrue(processInfo.childProcess.terminatedIntentionally));
269269
});
270270

271271
describe('intentionally gracefully with non-zero status code', () => {
@@ -284,7 +284,7 @@ describe('Babysitting Child Processes', () => {
284284
it('does not emit the \'crash\' event', () => assert.isFalse(processInfo.onCrash.called));
285285
it('is flagged as terminated', () => assert.isTrue(processInfo.childProcess.terminated));
286286
it('is not flagged as intentionally killed', () => assert.isFalse(processInfo.childProcess.killedIntentionally));
287-
return it('is flagged as intentionally terminated', () => assert.isTrue(processInfo.childProcess.terminatedIntentionally));
287+
it('is flagged as intentionally terminated', () => assert.isTrue(processInfo.childProcess.terminatedIntentionally));
288288
});
289289

290290
describe('intentionally forcefully', () => {
@@ -308,7 +308,7 @@ describe('Babysitting Child Processes', () => {
308308
it('does not emit the \'crash\' event', () => assert.isFalse(processInfo.onCrash.called));
309309
it('is flagged as terminated', () => assert.isTrue(processInfo.childProcess.terminated));
310310
it('is flagged as intentionally killed', () => assert.isTrue(processInfo.childProcess.killedIntentionally));
311-
return it('is not flagged as intentionally terminated', () => assert.isFalse(processInfo.childProcess.terminatedIntentionally));
311+
it('is not flagged as intentionally terminated', () => assert.isFalse(processInfo.childProcess.terminatedIntentionally));
312312
});
313313

314314
describe('gracefully with zero status code', () => {
@@ -332,7 +332,7 @@ describe('Babysitting Child Processes', () => {
332332
it('does not emit the \'crash\' event', () => assert.isFalse(processInfo.onCrash.called));
333333
it('is flagged as terminated', () => assert.isTrue(processInfo.childProcess.terminated));
334334
it('is not flagged as intentionally killed', () => assert.isFalse(processInfo.childProcess.killedIntentionally));
335-
return it('is not flagged as intentionally terminated', () => assert.isFalse(processInfo.childProcess.terminatedIntentionally));
335+
it('is not flagged as intentionally terminated', () => assert.isFalse(processInfo.childProcess.terminatedIntentionally));
336336
});
337337

338338
describe('gracefully with non-zero status code', () => {
@@ -358,10 +358,10 @@ describe('Babysitting Child Processes', () => {
358358
it('the \'crash\' event is not provided with killed flag', () => assert.isFalse(processInfo.onCrash.getCall(0).args[1]));
359359
it('is flagged as terminated', () => assert.isTrue(processInfo.childProcess.terminated));
360360
it('is not flagged as intentionally killed', () => assert.isFalse(processInfo.childProcess.killedIntentionally));
361-
return it('is not flagged as intentionally terminated', () => assert.isFalse(processInfo.childProcess.terminatedIntentionally));
361+
it('is not flagged as intentionally terminated', () => assert.isFalse(processInfo.childProcess.terminatedIntentionally));
362362
});
363363

364-
return describe('forcefully', () => {
364+
describe('forcefully', () => {
365365
let processInfo;
366366

367367
before(done =>
@@ -394,7 +394,7 @@ describe('Babysitting Child Processes', () => {
394394
}
395395
it('is flagged as terminated', () => assert.isTrue(processInfo.childProcess.terminated));
396396
it('is not flagged as intentionally killed', () => assert.isFalse(processInfo.childProcess.killedIntentionally));
397-
return it('is not flagged as intentionally terminated', () => assert.isFalse(processInfo.childProcess.terminatedIntentionally));
397+
it('is not flagged as intentionally terminated', () => assert.isFalse(processInfo.childProcess.terminatedIntentionally));
398398
});
399399
});
400400
});

test/integration/cli/api-blueprint-cli-test.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ describe('CLI - API Blueprint Document', () =>
2323
});
2424

2525
it('should request /machines', () => assert.deepEqual(runtimeInfo.server.requestCounts, { '/machines': 1 }));
26-
return it('should exit with status 0', () => assert.equal(runtimeInfo.dredd.exitStatus, 0));
26+
it('should exit with status 0', () => assert.equal(runtimeInfo.dredd.exitStatus, 0));
2727
});
2828

2929
describe('when API Blueprint is loaded with errors', () => {
@@ -42,10 +42,10 @@ describe('CLI - API Blueprint Document', () =>
4242
});
4343

4444
it('should exit with status 1', () => assert.equal(runtimeInfo.dredd.exitStatus, 1));
45-
return it('should print error message to stderr', () => assert.include(runtimeInfo.dredd.stderr, 'Error when processing API description'));
45+
it('should print error message to stderr', () => assert.include(runtimeInfo.dredd.stderr, 'Error when processing API description'));
4646
});
4747

48-
return describe('when API Blueprint is loaded with warnings', () => {
48+
describe('when API Blueprint is loaded with warnings', () => {
4949
let runtimeInfo;
5050
const args = [
5151
'./test/fixtures/warning-blueprint.apib',
@@ -62,7 +62,7 @@ describe('CLI - API Blueprint Document', () =>
6262
});
6363

6464
it('should exit with status 0', () => assert.equal(runtimeInfo.dredd.exitStatus, 0));
65-
return it('should print warning to stdout', () => assert.include(runtimeInfo.dredd.stdout, 'warn: Compilation warning'));
65+
it('should print warning to stdout', () => assert.include(runtimeInfo.dredd.stdout, 'warn: Compilation warning'));
6666
});
6767
})
6868
);

test/integration/cli/api-description-cli-test.js

+17-17
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ describe('CLI - API Description Document', () => {
2727
});
2828

2929
it('should request /machines', () => assert.deepEqual(runtimeInfo.server.requestCounts, { '/machines': 1 }));
30-
return it('should exit with status 0', () => assert.equal(runtimeInfo.dredd.exitStatus, 0));
30+
it('should exit with status 0', () => assert.equal(runtimeInfo.dredd.exitStatus, 0));
3131
});
3232

3333
describe('when file not found', () => {
@@ -46,10 +46,10 @@ describe('CLI - API Description Document', () => {
4646
});
4747

4848
it('should exit with status 1', () => assert.equal(runtimeInfo.dredd.exitStatus, 1));
49-
return it('should print error message to stderr', () => assert.include(runtimeInfo.dredd.stderr, 'not found'));
49+
it('should print error message to stderr', () => assert.include(runtimeInfo.dredd.stderr, 'not found'));
5050
});
5151

52-
return describe('when given path exists, but can\'t be read', () => {
52+
describe('when given path exists, but can\'t be read', () => {
5353
let runtimeInfo;
5454
const args = [
5555
os.homedir(),
@@ -65,7 +65,7 @@ describe('CLI - API Description Document', () => {
6565
});
6666

6767
it('should exit with status 1', () => assert.equal(runtimeInfo.dredd.exitStatus, 1));
68-
return it('should print error message to stderr', () => assert.include(runtimeInfo.dredd.stderr, 'Error when reading file'));
68+
it('should print error message to stderr', () => assert.include(runtimeInfo.dredd.stderr, 'Error when reading file'));
6969
});
7070
});
7171

@@ -95,7 +95,7 @@ describe('CLI - API Description Document', () => {
9595

9696
it('should download API Description Document from server', () => assert.equal(runtimeInfo.server.requestCounts['/single-get.apib'], 1));
9797
it('should request /machines', () => assert.deepEqual(runtimeInfo.server.requestCounts, { '/machines': 1, '/single-get.apib': 1 }));
98-
return it('should exit with status 0', () => assert.equal(runtimeInfo.dredd.exitStatus, 0));
98+
it('should exit with status 0', () => assert.equal(runtimeInfo.dredd.exitStatus, 0));
9999
});
100100

101101
describe('when URL points to non-existent server', () => {
@@ -115,14 +115,14 @@ describe('CLI - API Description Document', () => {
115115

116116
it('should not request server', () => assert.isFalse(runtimeInfo.server.requested));
117117
it('should exit with status 1', () => assert.equal(runtimeInfo.dredd.exitStatus, 1));
118-
return it('should print error message to stderr', () => {
118+
it('should print error message to stderr', () => {
119119
assert.include(runtimeInfo.dredd.stderr, 'Error when loading file from URL');
120120
assert.include(runtimeInfo.dredd.stderr, 'Is the provided URL correct?');
121-
return assert.include(runtimeInfo.dredd.stderr, `http://127.0.0.1:${NON_EXISTENT_PORT}/single-get.apib`);
121+
assert.include(runtimeInfo.dredd.stderr, `http://127.0.0.1:${NON_EXISTENT_PORT}/single-get.apib`);
122122
});
123123
});
124124

125-
return describe('when URL points to non-existent resource', () => {
125+
describe('when URL points to non-existent resource', () => {
126126
let runtimeInfo;
127127
const args = [
128128
`http://127.0.0.1:${DEFAULT_SERVER_PORT}/__non-existent__.apib`,
@@ -141,16 +141,16 @@ describe('CLI - API Description Document', () => {
141141

142142
it('should request server', () => assert.isTrue(runtimeInfo.server.requested));
143143
it('should exit with status 1', () => assert.equal(runtimeInfo.dredd.exitStatus, 1));
144-
return it('should print error message to stderr', () => {
144+
it('should print error message to stderr', () => {
145145
assert.include(runtimeInfo.dredd.stderr, 'Unable to load file from URL');
146146
assert.include(runtimeInfo.dredd.stderr, 'responded with status code 404');
147-
return assert.include(runtimeInfo.dredd.stderr, `http://127.0.0.1:${DEFAULT_SERVER_PORT}/__non-existent__.apib`);
147+
assert.include(runtimeInfo.dredd.stderr, `http://127.0.0.1:${DEFAULT_SERVER_PORT}/__non-existent__.apib`);
148148
});
149149
});
150150
});
151151

152152

153-
return describe('when loaded by -p/--path', () => {
153+
describe('when loaded by -p/--path', () => {
154154
describe('when loaded from file', () => {
155155
let runtimeInfo;
156156
const args = [
@@ -171,7 +171,7 @@ describe('CLI - API Description Document', () => {
171171
});
172172

173173
it('should request /machines, /machines/willy', () => assert.deepEqual(runtimeInfo.server.requestCounts, { '/machines': 1, '/machines/willy': 1 }));
174-
return it('should exit with status 0', () => assert.equal(runtimeInfo.dredd.exitStatus, 0));
174+
it('should exit with status 0', () => assert.equal(runtimeInfo.dredd.exitStatus, 0));
175175
});
176176

177177
describe('when loaded from URL', () => {
@@ -200,7 +200,7 @@ describe('CLI - API Description Document', () => {
200200

201201
it('should download API Description Document from server', () => assert.equal(runtimeInfo.server.requestCounts['/single-get.yaml'], 1));
202202
it('should request /machines, /machines/willy', () => assert.deepEqual(runtimeInfo.server.requestCounts, { '/machines': 1, '/machines/willy': 1, '/single-get.yaml': 1 }));
203-
return it('should exit with status 0', () => assert.equal(runtimeInfo.dredd.exitStatus, 0));
203+
it('should exit with status 0', () => assert.equal(runtimeInfo.dredd.exitStatus, 0));
204204
});
205205

206206
describe('when used multiple times', () => {
@@ -225,7 +225,7 @@ describe('CLI - API Description Document', () => {
225225
});
226226

227227
it('should request /machines, /machines/willy, /machines/caterpillar', () => assert.deepEqual(runtimeInfo.server.requestCounts, { '/machines': 1, '/machines/willy': 1, '/machines/caterpillar': 1 }));
228-
return it('should exit with status 0', () => assert.equal(runtimeInfo.dredd.exitStatus, 0));
228+
it('should exit with status 0', () => assert.equal(runtimeInfo.dredd.exitStatus, 0));
229229
});
230230

231231
describe('when loaded by glob pattern', () => {
@@ -248,10 +248,10 @@ describe('CLI - API Description Document', () => {
248248
});
249249

250250
it('should request /machines, /machines/willy', () => assert.deepEqual(runtimeInfo.server.requestCounts, { '/machines': 1, '/machines/willy': 1 }));
251-
return it('should exit with status 0', () => assert.equal(runtimeInfo.dredd.exitStatus, 0));
251+
it('should exit with status 0', () => assert.equal(runtimeInfo.dredd.exitStatus, 0));
252252
});
253253

254-
return describe('when additional file not found', () => {
254+
describe('when additional file not found', () => {
255255
let runtimeInfo;
256256
const args = [
257257
'./test/fixtures/single-get.apib',
@@ -271,7 +271,7 @@ describe('CLI - API Description Document', () => {
271271

272272
it('should not request server', () => assert.isFalse(runtimeInfo.server.requested));
273273
it('should exit with status 1', () => assert.equal(runtimeInfo.dredd.exitStatus, 1));
274-
return it('should print error message to stderr', () => assert.include(runtimeInfo.dredd.stderr, 'not found'));
274+
it('should print error message to stderr', () => assert.include(runtimeInfo.dredd.stderr, 'not found'));
275275
});
276276
});
277277
});

0 commit comments

Comments
 (0)