Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 72a97b6

Browse filesBrowse 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 <cjihrig@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 9c2f686 commit 72a97b6
Copy full SHA for 72a97b6

File tree

Expand file treeCollapse file tree

1 file changed

+4
-3
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-3
lines changed
Open diff view settings
Collapse file

‎test/parallel/test-readline-keys.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-readline-keys.js
+4-3Lines changed: 4 additions & 3 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.