Redo all of the screenshots

And commit fixtures so we can easily reproduce them.

The `snapshot-testin.png` screenshot will come as a separate repo in the AVA org.
This commit is contained in:
Sindre Sorhus 2017-06-27 22:51:45 +02:00
parent 589489db04
commit 2360256137
20 changed files with 98 additions and 7 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 174 KiB

After

Width:  |  Height:  |  Size: 182 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 34 KiB

BIN
media/mini-reporter.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 398 KiB

View file

@ -0,0 +1,11 @@
import test from 'ava';
test('nested', t => {
const actual = {
a: {
b: false
}
};
t.true(actual.a.b);
});

View file

@ -0,0 +1,19 @@
import test from 'ava';
test('objects', t => {
const actual = {
a: 1,
b: {
c: 2
}
};
const expected = {
a: 1,
b: {
c: 3
}
};
t.deepEqual(actual, expected);
});

View file

@ -0,0 +1,7 @@
import test from 'ava';
test('strings', t => {
const actual = 'this is amazing';
const expected = 'this is cool';
t.is(actual, expected);
});

View file

@ -0,0 +1 @@
Run the [Got](https://github.com/sindresorhus/got) tests.

View file

@ -0,0 +1,42 @@
import test from 'ava';
test('a', t => {
t.pass();
});
test('b', t => {
t.pass();
});
test('c', t => {
t.pass();
});
test('d', t => {
t.pass();
});
test('e', t => {
t.pass();
});
test('f', t => {
t.pass();
});
test('g', t => {
t.pass();
});
test('h', t => {
t.pass();
});
test('i', t => {
t.pass();
});
test('j', t => {
t.pass();
});

View file

@ -0,0 +1,9 @@
import test from 'ava';
test('unicorn', t => {
t.pass();
});
test('rainbow', t => {
t.pass();
});

Binary file not shown.

Before

Width:  |  Height:  |  Size: 117 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

BIN
media/tap-reporter.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
media/verbose-reporter.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

View file

@ -202,6 +202,9 @@
},
"typings": "types/generated.d.ts",
"xo": {
"ignores": [
"media/**"
],
"rules": {
"no-use-extend-native/no-use-extend-native": "off"
}

View file

@ -6,7 +6,7 @@
Even though JavaScript is single-threaded, IO in Node.js can happen in parallel due to its async nature. AVA takes advantage of this and runs your tests concurrently, which is especially beneficial for IO heavy tests. In addition, test files are run in parallel as separate processes, giving you even better performance and an isolated environment for each test file. [Switching](https://github.com/sindresorhus/pageres/commit/663be15acb3dd2eb0f71b1956ef28c2cd3fdeed0) from Mocha to AVA in Pageres brought the test time down from 31 to 11 seconds. Having tests run concurrently forces you to write atomic tests, meaning tests don't depend on global state or the state of other tests, which is a great thing!
![](media/screenshot-mini-reporter.gif)
![](media/mini-reporter.gif)
*Read our [contributing guide](contributing.md) if you're looking to contribute (issues/PRs/etc).*
@ -212,13 +212,13 @@ $ node --inspect node_modules/ava/profile.js some/test/file.js
The mini-reporter is the default reporter.
<img src="media/screenshot-mini-reporter.gif" width="460">
<img src="media/mini-reporter.gif" width="460">
### Verbose reporter
Use the `--verbose` flag to enable the verbose reporter. This is always used in CI environments unless the [TAP reporter](#tap-reporter) is enabled.
<img src="media/screenshot.png" width="150">
<img src="media/verbose-reporter.png" width="294">
### TAP reporter
@ -228,7 +228,7 @@ AVA supports the TAP format and thus is compatible with [any TAP reporter](https
$ ava --tap | tap-nyan
```
<img src="media/tap-output.png" width="398">
<img src="media/tap-reporter.png" width="420">
Please note that the TAP reporter is unavailable when using [watch mode](#watch-it).
@ -1014,11 +1014,10 @@ export default HelloWorld;
// Your test
import test from 'ava';
import render from 'react-test-renderer';
import HelloWorld from '.';
test('HelloWorld component', t => {
const tree = render.create(<HelloWorld />).toJSON();
const tree = render.create(<HelloWorld/>).toJSON();
t.snapshot(tree);
});
```
@ -1034,7 +1033,7 @@ The first file contains the actual snapshot and is required for future compariso
AVA will show why your snapshot assertion failed:
<img src="media/snapshot-testing.png" width="814">
<img src="media/snapshot-testing.png" width="1048">
You can then check your code. If the change was intentional you can use the `--update-snapshots` (or `-u`) flag to update the snapshots: