Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed May 17, 2019
1 parent f662166 commit 7160605
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 25 deletions.
2 changes: 1 addition & 1 deletion test/input.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ testEach(

testEach(
METHODS,
[{ opts: { encoding: 'invalid' } }, { command: 'invalid', read: false }],
[{ opts: { uid: 0.5 } }, { command: 'invalid', read: false }],
(suffix, methodProps, data) =>
test(`Errored command ${suffix}`, t =>
snapshotTest({ t, methodProps, data })),
Expand Down
56 changes: 32 additions & 24 deletions test/snapshots/input.js.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,21 @@ Generated by [AVA](https://ava.li).
[12:00:00] [gulp-execa] invalid`,
}

## Errored command | exec { opts: { encoding: 'invalid' } }
## Errored command | exec { opts: { uid: 0.5 } }

> Snapshot 1
{
exitCode: 0,
stderr: '',
exitCode: 1,
stderr: `[12:00:00] 'main' errored after 100 ms␊
[12:00:00] TypeError [ERR_INVALID_ARG_TYPE] in plugin "gulp-execa"␊
Message:␊
The "options.uid" property must be of type int32. Received type number␊
Stack:␊
TypeError [ERR_INVALID_ARG_TYPE]: The "options.uid" property must be of type int32. Received type number␊
at STACK TRACE`,
stdout: `[12:00:00] Starting 'main'...␊
[12:00:00] [gulp-execa] echo test␊
test␊
[12:00:00] Finished 'main' after 100 ms`,
[12:00:00] [gulp-execa] echo test`,
}

## Errored command | stream-buffer { command: 'invalid', read: false }
Expand All @@ -42,18 +46,18 @@ Generated by [AVA](https://ava.li).
stdout: '[12:00:00] Starting \'main\'...',
}

## Errored command | stream-buffer { opts: { encoding: 'invalid' } }
## Errored command | stream-buffer { opts: { uid: 0.5 } }

> Snapshot 1
{
exitCode: 1,
stderr: `[12:00:00] 'main' errored after 100 ms␊
[12:00:00] TypeError in plugin "gulp-execa"␊
[12:00:00] TypeError [ERR_INVALID_ARG_TYPE] in plugin "gulp-execa"␊
Message:␊
stdout Unknown encoding: invalid
The "options.uid" property must be of type int32. Received type number
Stack:␊
TypeError [ERR_UNKNOWN_ENCODING]: Unknown encoding: invalid
TypeError [ERR_INVALID_ARG_TYPE]: The "options.uid" property must be of type int32. Received type number
at STACK TRACE`,
stdout: '[12:00:00] Starting \'main\'...',
}
Expand All @@ -70,18 +74,18 @@ Generated by [AVA](https://ava.li).
stdout: '[12:00:00] Starting \'main\'...',
}

## Errored command | stream-save { opts: { encoding: 'invalid' } }
## Errored command | stream-save { opts: { uid: 0.5 } }

> Snapshot 1
{
exitCode: 1,
stderr: `[12:00:00] 'main' errored after 100 ms␊
[12:00:00] TypeError in plugin "gulp-execa"␊
[12:00:00] TypeError [ERR_INVALID_ARG_TYPE] in plugin "gulp-execa"␊
Message:␊
stdout Unknown encoding: invalid
The "options.uid" property must be of type int32. Received type number
Stack:␊
TypeError [ERR_UNKNOWN_ENCODING]: Unknown encoding: invalid
TypeError [ERR_INVALID_ARG_TYPE]: The "options.uid" property must be of type int32. Received type number
at STACK TRACE`,
stdout: '[12:00:00] Starting \'main\'...',
}
Expand All @@ -99,18 +103,18 @@ Generated by [AVA](https://ava.li).
[12:00:00] Finished 'main' after 100 ms`,
}

## Errored command | stream-stream { opts: { encoding: 'invalid' } }
## Errored command | stream-stream { opts: { uid: 0.5 } }

> Snapshot 1
{
exitCode: 1,
stderr: `[12:00:00] 'main' errored after 100 ms␊
[12:00:00] TypeError in plugin "gulp-execa"␊
[12:00:00] TypeError [ERR_INVALID_ARG_TYPE] in plugin "gulp-execa"␊
Message:␊
stdout Unknown encoding: invalid
The "options.uid" property must be of type int32. Received type number
Stack:␊
TypeError [ERR_UNKNOWN_ENCODING]: Unknown encoding: invalid
TypeError [ERR_INVALID_ARG_TYPE]: The "options.uid" property must be of type int32. Received type number
at STACK TRACE`,
stdout: '[12:00:00] Starting \'main\'...',
}
Expand All @@ -128,17 +132,21 @@ Generated by [AVA](https://ava.li).
[12:00:00] [gulp-execa] invalid`,
}

## Errored command | task { opts: { encoding: 'invalid' } }
## Errored command | task { opts: { uid: 0.5 } }

> Snapshot 1
{
exitCode: 0,
stderr: '',
exitCode: 1,
stderr: `[12:00:00] 'main' errored after 100 ms␊
[12:00:00] TypeError [ERR_INVALID_ARG_TYPE] in plugin "gulp-execa"␊
Message:␊
The "options.uid" property must be of type int32. Received type number␊
Stack:␊
TypeError [ERR_INVALID_ARG_TYPE]: The "options.uid" property must be of type int32. Received type number␊
at STACK TRACE`,
stdout: `[12:00:00] Starting 'main'...␊
[12:00:00] [gulp-execa] echo test␊
test␊
[12:00:00] Finished 'main' after 100 ms`,
[12:00:00] [gulp-execa] echo test`,
}

## Invalid command | exec { command: ' ' }
Expand Down
Binary file modified test/snapshots/input.js.snap
Binary file not shown.

0 comments on commit 7160605

Please sign in to comment.