Skip to content

Commit

Permalink
Add snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed May 17, 2019
1 parent 4007b5e commit de50e41
Show file tree
Hide file tree
Showing 23 changed files with 14,988 additions and 7 deletions.
8 changes: 1 addition & 7 deletions test/helpers/snapshot.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,7 @@ export const snapshotTest = async function({ t, methodProps = {}, data }) {
...data,
opts,
})
// eslint-disable-next-line no-restricted-globals, no-console
console.log(exitCode)
// eslint-disable-next-line no-restricted-globals, no-console
console.log(stdout)
// eslint-disable-next-line no-restricted-globals, no-console
console.log(stderr)
t.pass()
t.snapshot({ exitCode, stdout, stderr })
}

const getOpts = function({ methodProps, data }) {
Expand Down
156 changes: 156 additions & 0 deletions test/snapshots/echo.js.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
# Snapshot report for `test/echo.js`

The actual snapshot is saved in `echo.js.snap`.

Generated by [AVA](https://ava.li).

## 'echo' option | exec { opts: { echo: false } }

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

## 'echo' option | exec { opts: { echo: true } }

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

## 'echo' option | stream-buffer { opts: { echo: false } }

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

## 'echo' option | stream-buffer { opts: { echo: true } }

> 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`,
}

## 'echo' option | stream-save { opts: { echo: false } }

> 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`,
}

## 'echo' option | stream-save { opts: { echo: true } }

> Snapshot 1
{
exitCode: 0,
stderr: '',
stdout: `[12:00:00] Starting 'main'...␊
[12:00:00] [gulp-execa] echo test␊
[␊
{␊
"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`,
}

## 'echo' option | stream-stream { opts: { echo: false } }

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

## 'echo' option | stream-stream { opts: { echo: true } }

> 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`,
}

## 'echo' option | task { opts: { echo: false } }

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

## 'echo' option | task { opts: { echo: true } }

> Snapshot 1
{
exitCode: 0,
stderr: '',
stdout: `[12:00:00] Starting 'main'...␊
[12:00:00] [gulp-execa] echo test␊
[12:00:00] Finished 'main' after 100 ms`,
}
Binary file added test/snapshots/echo.js.snap
Binary file not shown.
16 changes: 16 additions & 0 deletions test/snapshots/exec.js.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Snapshot report for `test/exec.js`

The actual snapshot is saved in `exec.js.snap`.

Generated by [AVA](https://ava.li).

## exec() | exec {}

> Snapshot 1
{
exitCode: 0,
stderr: '',
stdout: `[12:00:00] Starting 'main'...␊
[12:00:00] Finished 'main' after 100 ms`,
}
Binary file added test/snapshots/exec.js.snap
Binary file not shown.
Loading

0 comments on commit de50e41

Please sign in to comment.