Skip to content

Commit

Permalink
fix: make opts optional (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
therealklanni committed Mar 3, 2022
1 parent 2040e04 commit 50c981a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const isPipe = (stdio = 'pipe', fd) =>
: false

// 'extra' object is for decorating the error a bit more
const promiseSpawn = (cmd, args, opts, extra = {}) => {
const promiseSpawn = (cmd, args, opts = {}, extra = {}) => {
const cwd = opts.cwd || process.cwd()
return promiseSpawnUid(cmd, args, {
...opts,
Expand Down
5 changes: 5 additions & 0 deletions test/promise-spawn.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@ t.test('pass', t => t.resolveMatch(promiseSpawn('pass', [], {stdioString: true},
a: 1,
}))

t.test('pass, default opts', t => t.resolveMatch(promiseSpawn('pass', []), {
code: 0,
signal: null
}))

t.test('pass, share stdio', t => t.resolveMatch(promiseSpawn('pass', [], { stdio: 'inherit'}, {a: 1}), {
code: 0,
signal: null,
Expand Down

0 comments on commit 50c981a

Please sign in to comment.