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.
|
Before Width: | Height: | Size: 174 KiB After Width: | Height: | Size: 182 KiB |
|
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 51 KiB |
|
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 34 KiB |
BIN
media/mini-reporter.gif
Normal file
|
After Width: | Height: | Size: 398 KiB |
11
media/screenshot-fixtures/magic-assert-nested.js
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
import test from 'ava';
|
||||
|
||||
test('nested', t => {
|
||||
const actual = {
|
||||
a: {
|
||||
b: false
|
||||
}
|
||||
};
|
||||
|
||||
t.true(actual.a.b);
|
||||
});
|
||||
19
media/screenshot-fixtures/magic-assert-objects.js
Normal 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);
|
||||
});
|
||||
7
media/screenshot-fixtures/magic-assert-strings.js
Normal 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);
|
||||
});
|
||||
1
media/screenshot-fixtures/mini-reporter.md
Normal file
|
|
@ -0,0 +1 @@
|
|||
Run the [Got](https://github.com/sindresorhus/got) tests.
|
||||
42
media/screenshot-fixtures/tap-reporter.js
Normal 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();
|
||||
});
|
||||
|
||||
9
media/screenshot-fixtures/verbose-reporter.js
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
import test from 'ava';
|
||||
|
||||
test('unicorn', t => {
|
||||
t.pass();
|
||||
});
|
||||
|
||||
test('rainbow', t => {
|
||||
t.pass();
|
||||
});
|
||||
|
Before Width: | Height: | Size: 117 KiB |
|
Before Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 61 KiB |
|
Before Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 15 KiB |
BIN
media/tap-reporter.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
media/verbose-reporter.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
|
|
@ -202,6 +202,9 @@
|
|||
},
|
||||
"typings": "types/generated.d.ts",
|
||||
"xo": {
|
||||
"ignores": [
|
||||
"media/**"
|
||||
],
|
||||
"rules": {
|
||||
"no-use-extend-native/no-use-extend-native": "off"
|
||||
}
|
||||
|
|
|
|||
13
readme.md
|
|
@ -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!
|
||||
|
||||

|
||||

|
||||
|
||||
*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:
|
||||
|
||||
|
|
|
|||