Skip to content

Commit 5e6d6d6

Browse files
committed
test(spawn): empty arguments and options
1 parent b76eb33 commit 5e6d6d6

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

test/spawn.spec.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,26 @@ describe('spawn', () => {
2626

2727
it('default - string', () => spawn(catCommand, fixturePath).should.become(fixture));
2828

29+
it('default - empty argument and options', async () => {
30+
if (isWindows) {
31+
const out = await spawn('ver');
32+
out.trim().startsWith('Microsoft Windows').should.eql(true);
33+
} else {
34+
const out = await spawn('uname');
35+
out.trim().should.eql('Linux');
36+
}
37+
});
38+
39+
it('default - options and empty argument', async () => {
40+
if (isWindows) {
41+
const out = await spawn('chdir', { cwd: __dirname });
42+
out.trim().should.eql(__dirname);
43+
} else {
44+
const out = await spawn('pwd', { cwd: __dirname });
45+
out.trim().should.eql(__dirname);
46+
}
47+
});
48+
2949
it('command is required', () => {
3050
spawn.should.throw('command is required!');
3151
});

0 commit comments

Comments
 (0)