Skip to content

Commit f2e689d

Browse files
committed
major(api): change api to return object, close #3
1 parent b53bf1f commit f2e689d

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/demo.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
const execa = require('execa')
2-
const stub = require('.')
2+
const { stubSpawnOnce } = require('.')
3+
4+
stubSpawnOnce(
5+
'/bin/sh -c echo "hello"',
6+
0, // exit code
7+
'hi from stub!', // stdout
8+
'and some error output' // stderr
9+
)
310

4-
stub('/bin/sh -c echo "hello"', 0, 'hi from stub!', 'and some error output')
511
execa
612
.shell('echo "hello"')
713
.then(console.log)

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,4 +96,4 @@ function stubSpawnOnce (command, exitCode, stdout, stderr) {
9696
}
9797
}
9898

99-
module.exports = stubSpawnOnce
99+
module.exports = { stubSpawnOnce }

0 commit comments

Comments
 (0)