Skip to content

Commit

Permalink
Fix Object.create(null) testing
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed May 18, 2019
1 parent 5d046cf commit ee5b3dd
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export const isPlainObject = function(val) {
return (
typeof val === 'object' &&
val !== null &&
// istanbul ignore next
(val.constructor === Object || val.constructor === undefined)
)
}
Expand Down
7 changes: 2 additions & 5 deletions test/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ testEach(
snapshotTest({ t, methodProps, data })),
)

testEach(
METHODS,
[{}, { opts: Object.create(null) }],
(suffix, methodProps, data) =>
test(`No options ${suffix}`, t => snapshotTest({ t, methodProps, data })),
testEach(METHODS, [{}, { opts: {} }], (suffix, methodProps, data) =>
test(`No options ${suffix}`, t => snapshotTest({ t, methodProps, data })),
)
77 changes: 77 additions & 0 deletions test/snapshots/options.js.md
Original file line number Diff line number Diff line change
Expand Up @@ -2915,3 +2915,80 @@ Generated by [AVA](https://ava.li).
test␊
[12:00:00] Finished 'main' after 100 ms`,
}

## No options | exec { opts: {} }

> Snapshot 1
{
exitCode: 0,
stderr: '',
stdout: `[12:00:00] Starting 'main'...␊
[12:00:00] [gulp-execa] echo test␊
test␊
[12:00:00] Finished 'main' after 100 ms`,
}

## No options | stream-buffer { opts: {} }

> Snapshot 1
{
exitCode: 0,
stderr: '',
stdout: `[12:00:00] Starting 'main'...␊
test␊
[12:00:00] Finished 'main' after 100 ms`,
}

## No options | stream-save { opts: {} }

> Snapshot 1
{
exitCode: 0,
stderr: '',
stdout: `[12:00:00] Starting 'main'...␊
[␊
{␊
"command": "echo test",␊
"exitCode": 0,␊
"exitCodeName": "SUCCESS",␊
"stdout": "test",␊
"stderr": "",␊
"all": "test",␊
"failed": false,␊
"timedOut": false,␊
"isCanceled": false,␊
"killed": false␊
}␊
]␊
[12:00:00] Finished 'main' after 100 ms`,
}

## No options | stream-stream { opts: {} }

> Snapshot 1
{
exitCode: 0,
stderr: '',
stdout: `[12:00:00] Starting 'main'...␊
test␊
[12:00:00] Finished 'main' after 100 ms`,
}

## No options | task { opts: {} }

> Snapshot 1
{
exitCode: 0,
stderr: '',
stdout: `[12:00:00] Starting 'main'...␊
[12:00:00] [gulp-execa] echo test␊
test␊
[12:00:00] Finished 'main' after 100 ms`,
}
Binary file modified test/snapshots/options.js.snap
Binary file not shown.

0 comments on commit ee5b3dd

Please sign in to comment.