Skip to content

Commit 72a97b6

Browse files
Trottevanlucas
authored andcommitted
test: guarantee test runs in test-readline-keys
Use common.mustCall() to guarantee that test functions (created by a factory function) are run. PR-URL: #11023 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 9c2f686 commit 72a97b6

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

test/parallel/test-readline-keys.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
'use strict';
2-
require('../common');
2+
const common = require('../common');
33
const PassThrough = require('stream').PassThrough;
44
const assert = require('assert');
55
const inherits = require('util').inherits;
@@ -55,7 +55,7 @@ function addTest(sequences, expectedKeys) {
5555

5656
const addKeyIntervalTest = (sequences, expectedKeys, interval = 550,
5757
assertDelay = 550) => {
58-
return (next) => () => {
58+
const fn = common.mustCall((next) => () => {
5959

6060
if (!Array.isArray(sequences)) {
6161
sequences = [ sequences ];
@@ -84,7 +84,8 @@ const addKeyIntervalTest = (sequences, expectedKeys, interval = 550,
8484
}
8585
};
8686
emitKeys(sequences);
87-
};
87+
});
88+
return fn;
8889
};
8990

9091
// regular alphanumerics

0 commit comments

Comments
 (0)