Skip to content

Commit 646f825

Browse files
TrottMylesBorins
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 d8eed12 commit 646f825

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

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

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
'use strict';
2-
require('../common');
3-
varPassThrough=require('stream').PassThrough;
4-
varassert=require('assert');
5-
varinherits=require('util').inherits;
6-
varextend=require('util')._extend;
7-
varInterface=require('readline').Interface;
2+
constcommon=require('../common');
3+
constPassThrough=require('stream').PassThrough;
4+
constassert=require('assert');
5+
constinherits=require('util').inherits;
6+
constextend=require('util')._extend;
7+
constInterface=require('readline').Interface;
88

99

1010
functionFakeInput(){
@@ -55,7 +55,7 @@ function addTest(sequences, expectedKeys) {
5555

5656
constaddKeyIntervalTest=(sequences,expectedKeys,interval=550,
5757
assertDelay=550)=>{
58-
return(next)=>()=>{
58+
constfn=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+
returnfn;
8889
};
8990

9091
// regular alphanumerics

0 commit comments

Comments
 (0)