Skip to content

Commit 262d955

Browse files
committed
code coverage update
1 parent 9882380 commit 262d955

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,8 @@ export const spawning = Sys.spawning = function (command, argument = [], progres
191191
if (typeof progressOptions == 'object' && !isFunction(progressOptions)) {
192192
options = Object.assign(options, progressOptions);
193193
progress = options.onprogress || null;
194+
} else if (!isFunction(progressOptions)) {
195+
progress = options.onprogress || null;
194196
}
195197

196198
let err = null;

test/test.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,18 @@ describe('Method: `spawning`', function () {
275275
});
276276
});
277277

278+
it('should return on successful install with output with options `null`', function (done) {
279+
spawning('echo', ['1'], { shell: true })
280+
.then(function (data) {
281+
expect(data).to.be.a('string');
282+
done();
283+
})
284+
.catch(function (err) {
285+
expect(err).to.be.empty;
286+
done();
287+
});
288+
});
289+
278290
it('should catch error on throw from `onprogress`', function (done) {
279291
spawning('echo', [''], {
280292
stdio: 'pipe',
@@ -291,11 +303,12 @@ describe('Method: `spawning`', function () {
291303
});
292304

293305
it('should return on successful `Sudo` run and catch any exceptions', function (done) {
294-
spawning((process.platform == 'win32' ? 'dir' : 'ls'), ['..'], {
306+
spawning((process.platform == 'win32' ? 'dir' : 'ls'), ['..'], null, {
295307
stdio: 'pipe',
296308
shell: true,
297309
sudo: true,
298310
onerror: (err) => { return 'testing: ' + err; },
311+
onprogress: () => { }
299312
// onmessage: (data) => { console.log('messaging: ' + data); },
300313
})
301314
.then(function () {

0 commit comments

Comments
 (0)