Skip to content

Commit

Permalink
test(spawn): empty arguments and options
Browse files Browse the repository at this point in the history
  • Loading branch information
curbengh committed Jul 23, 2020
1 parent b76eb33 commit 5e6d6d6
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/spawn.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,26 @@ describe('spawn', () => {

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

it('default - empty argument and options', async () => {
if (isWindows) {
const out = await spawn('ver');
out.trim().startsWith('Microsoft Windows').should.eql(true);
} else {
const out = await spawn('uname');
out.trim().should.eql('Linux');
}
});

it('default - options and empty argument', async () => {
if (isWindows) {
const out = await spawn('chdir', { cwd: __dirname });
out.trim().should.eql(__dirname);
} else {
const out = await spawn('pwd', { cwd: __dirname });
out.trim().should.eql(__dirname);
}
});

it('command is required', () => {
spawn.should.throw('command is required!');
});
Expand Down

0 comments on commit 5e6d6d6

Please sign in to comment.