Skip to content

Commit cddc32c

Browse files
itsmedMylesBorins
authored andcommitted
test: replace throw with common.fail
Replace anonymous functions with arrow functions. Replace throw new Error with common.fail. PR-URL: #9700 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Italo A. Casas <me@italoacasas.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
1 parent f23377c commit cddc32c

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

‎test/parallel/test-fs-empty-readStream.js‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,32 @@ const fs = require('fs');
77
constemptyFile=path.join(common.fixturesDir,'empty.txt');
88

99
fs.open(emptyFile,'r',common.mustCall((error,fd)=>{
10+
1011
assert.ifError(error);
1112

12-
constread=fs.createReadStream(emptyFile,{'fd': fd});
13+
constread=fs.createReadStream(emptyFile,{ fd });
1314

1415
read.once('data',()=>{
15-
thrownewError('data event should not emit');
16+
common.fail('data event should not emit');
1617
});
1718

1819
read.once('end',common.mustCall(functionendEvent1(){}));
1920
}));
2021

2122
fs.open(emptyFile,'r',common.mustCall((error,fd)=>{
23+
2224
assert.ifError(error);
2325

24-
constread=fs.createReadStream(emptyFile,{'fd': fd});
26+
constread=fs.createReadStream(emptyFile,{ fd });
27+
2528
read.pause();
2629

2730
read.once('data',()=>{
28-
thrownewError('data event should not emit');
31+
common.fail('data event should not emit');
2932
});
3033

3134
read.once('end',functionendEvent2(){
32-
thrownewError('end event should not emit');
35+
common.fail('end event should not emit');
3336
});
3437

3538
setTimeout(common.mustCall(()=>{

0 commit comments

Comments
 (0)