Skip to content

Commit 1850490

Browse files
authoredJan 4, 2021
test: adjust timeouts and set exit flag (#230)
1 parent cebea21 commit 1850490

File tree

3 files changed

+7
-15
lines changed

3 files changed

+7
-15
lines changed
 

‎.mocharc.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"check-leaks": true,
3-
"timeout": 60000,
3+
"timeout": 2000,
44
"throw-deprecation": true,
5-
"enable-source-maps": true
5+
"enable-source-maps": true,
6+
"exit": true
67
}

‎src/queue.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export class Queue {
4040
return;
4141
}
4242
const timer = setInterval(async () => {
43-
if (this.activeTimers === 0 && this.q.size === 0) {
43+
if (this.activeTimers === 0) {
4444
await this.q.onIdle();
4545
clearInterval(timer);
4646
resolve();

‎test/test.cli.ts

+3-12
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@ import * as util from 'util';
66
import enableDestroy = require('server-destroy');
77
import {LinkResult, LinkState} from '../src/index';
88

9-
describe('cli', () => {
9+
// eslint-disable-next-line prefer-arrow-callback
10+
describe('cli', function () {
1011
let server: http.Server;
12+
this.timeout(30_000);
1113

1214
if (process.env.LINKINATOR_SKIP_CLI_TESTS) {
1315
return;
@@ -142,17 +144,6 @@ describe('cli', () => {
142144
assert.match(res.stderr, /FORMAT must be/);
143145
});
144146

145-
it('should throw on invalid format', async () => {
146-
const res = await execa(
147-
'npx',
148-
['linkinator', './README.md', '--format', 'LOL'],
149-
{
150-
reject: false,
151-
}
152-
);
153-
assert.match(res.stderr, /FORMAT must be/);
154-
});
155-
156147
it('should throw on invalid verbosity', async () => {
157148
const res = await execa(
158149
'npx',

0 commit comments

Comments
 (0)
Please sign in to comment.