ava 2.0.0 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/eslint-plugin-helper.js +26 -7
- package/index.d.ts +96 -23
- package/lib/api.js +17 -3
- package/lib/assert.js +21 -25
- package/lib/babel-pipeline.js +27 -15
- package/lib/cli.js +32 -5
- package/lib/fork.js +1 -0
- package/lib/globs.js +4 -4
- package/lib/load-config.js +41 -13
- package/lib/parse-test-args.js +15 -0
- package/lib/reporters/mini.js +5 -0
- package/lib/reporters/tap.js +23 -4
- package/lib/reporters/verbose.js +3 -0
- package/lib/runner.js +29 -27
- package/lib/serialize-error.js +7 -2
- package/lib/snapshot-manager.js +39 -20
- package/lib/test.js +236 -31
- package/lib/watcher.js +5 -4
- package/lib/worker/fake-tty-has-colors.js +19 -0
- package/lib/worker/fake-tty.js +59 -13
- package/lib/worker/subprocess.js +1 -0
- package/package.json +52 -45
- package/profile.js +8 -5
- package/readme.md +4 -2
package/package.json
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ava",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.0",
|
|
4
4
|
"description": "Testing can be a drag. AVA helps you get it done.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "avajs/ava",
|
|
7
7
|
"homepage": "https://avajs.dev",
|
|
8
8
|
"bin": "cli.js",
|
|
9
9
|
"engines": {
|
|
10
|
-
"node": ">=8.9.4 <9 || >=10.0.0"
|
|
10
|
+
"node": ">=8.9.4 <9 || >=10.0.0 <11 || >=12.0.0"
|
|
11
11
|
},
|
|
12
12
|
"scripts": {
|
|
13
13
|
"lint": "xo",
|
|
14
|
-
"test:tap": "tap
|
|
14
|
+
"test:tap": "tap",
|
|
15
15
|
"test:typescript": "tsc --noEmit -p test/ts-types",
|
|
16
|
-
"test": "npm run lint && npm run test:typescript &&
|
|
16
|
+
"test": "npm run lint && npm run test:typescript && npm run test:tap"
|
|
17
17
|
},
|
|
18
18
|
"files": [
|
|
19
19
|
"lib",
|
|
@@ -57,29 +57,26 @@
|
|
|
57
57
|
"typescript"
|
|
58
58
|
],
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@ava/babel-preset-stage-4": "^
|
|
61
|
-
"@ava/babel-preset-transform-test-files": "^
|
|
62
|
-
"@babel/core": "^7.
|
|
63
|
-
"@babel/generator": "^7.
|
|
64
|
-
"@babel/plugin-syntax-async-generators": "^7.2.0",
|
|
65
|
-
"@babel/plugin-syntax-object-rest-spread": "^7.2.0",
|
|
66
|
-
"@babel/plugin-syntax-optional-catch-binding": "^7.2.0",
|
|
60
|
+
"@ava/babel-preset-stage-4": "^4.0.0",
|
|
61
|
+
"@ava/babel-preset-transform-test-files": "^6.0.0",
|
|
62
|
+
"@babel/core": "^7.6.0",
|
|
63
|
+
"@babel/generator": "^7.6.0",
|
|
67
64
|
"@concordance/react": "^2.0.0",
|
|
68
|
-
"ansi-escapes": "^4.1
|
|
69
|
-
"ansi-styles": "^4.
|
|
65
|
+
"ansi-escapes": "^4.2.1",
|
|
66
|
+
"ansi-styles": "^4.1.0",
|
|
70
67
|
"arr-flatten": "^1.1.0",
|
|
71
68
|
"array-union": "^2.1.0",
|
|
72
69
|
"array-uniq": "^2.1.0",
|
|
73
70
|
"arrify": "^2.0.1",
|
|
74
71
|
"bluebird": "^3.5.5",
|
|
75
72
|
"chalk": "^2.4.2",
|
|
76
|
-
"chokidar": "^3.0.
|
|
73
|
+
"chokidar": "^3.0.2",
|
|
77
74
|
"chunkd": "^1.0.0",
|
|
78
75
|
"ci-parallel-vars": "^1.0.0",
|
|
79
|
-
"clean-stack": "^2.
|
|
76
|
+
"clean-stack": "^2.2.0",
|
|
80
77
|
"clean-yaml-object": "^0.1.0",
|
|
81
|
-
"cli-cursor": "^3.
|
|
82
|
-
"cli-truncate": "^
|
|
78
|
+
"cli-cursor": "^3.1.0",
|
|
79
|
+
"cli-truncate": "^2.0.0",
|
|
83
80
|
"code-excerpt": "^2.1.1",
|
|
84
81
|
"common-path-prefix": "^1.0.0",
|
|
85
82
|
"concordance": "^4.0.0",
|
|
@@ -87,32 +84,32 @@
|
|
|
87
84
|
"currently-unhandled": "^0.4.1",
|
|
88
85
|
"debug": "^4.1.1",
|
|
89
86
|
"del": "^4.1.1",
|
|
90
|
-
"dot-prop": "^5.
|
|
87
|
+
"dot-prop": "^5.1.0",
|
|
91
88
|
"emittery": "^0.4.1",
|
|
92
89
|
"empower-core": "^1.2.0",
|
|
93
90
|
"equal-length": "^1.0.0",
|
|
94
91
|
"escape-string-regexp": "^2.0.0",
|
|
95
92
|
"esm": "^3.2.25",
|
|
96
93
|
"figures": "^3.0.0",
|
|
97
|
-
"find-up": "^4.
|
|
94
|
+
"find-up": "^4.1.0",
|
|
98
95
|
"get-port": "^5.0.0",
|
|
99
|
-
"globby": "^
|
|
96
|
+
"globby": "^10.0.1",
|
|
100
97
|
"ignore-by-default": "^1.0.0",
|
|
101
|
-
"import-local": "^
|
|
98
|
+
"import-local": "^3.0.2",
|
|
102
99
|
"indent-string": "^4.0.0",
|
|
103
100
|
"is-ci": "^2.0.0",
|
|
104
101
|
"is-error": "^2.2.2",
|
|
105
102
|
"is-observable": "^2.0.0",
|
|
106
103
|
"is-plain-object": "^3.0.0",
|
|
107
104
|
"is-promise": "^2.1.0",
|
|
108
|
-
"lodash": "^4.17.
|
|
105
|
+
"lodash": "^4.17.15",
|
|
109
106
|
"loud-rejection": "^2.1.0",
|
|
110
107
|
"make-dir": "^3.0.0",
|
|
111
108
|
"matcher": "^2.0.0",
|
|
112
|
-
"md5-hex": "^3.0.
|
|
109
|
+
"md5-hex": "^3.0.1",
|
|
113
110
|
"meow": "^5.0.0",
|
|
114
111
|
"micromatch": "^4.0.2",
|
|
115
|
-
"ms": "^2.1.
|
|
112
|
+
"ms": "^2.1.2",
|
|
116
113
|
"observable-to-promise": "^1.0.0",
|
|
117
114
|
"ora": "^3.4.0",
|
|
118
115
|
"package-hash": "^4.0.0",
|
|
@@ -122,40 +119,39 @@
|
|
|
122
119
|
"require-precompiled": "^0.1.0",
|
|
123
120
|
"resolve-cwd": "^3.0.0",
|
|
124
121
|
"slash": "^3.0.0",
|
|
125
|
-
"source-map-support": "^0.5.
|
|
122
|
+
"source-map-support": "^0.5.13",
|
|
126
123
|
"stack-utils": "^1.0.2",
|
|
127
124
|
"strip-ansi": "^5.2.0",
|
|
128
125
|
"strip-bom-buf": "^2.0.0",
|
|
129
126
|
"supertap": "^1.0.0",
|
|
130
|
-
"supports-color": "^
|
|
127
|
+
"supports-color": "^7.0.0",
|
|
131
128
|
"trim-off-newlines": "^1.0.1",
|
|
132
129
|
"trim-right": "^1.0.1",
|
|
133
130
|
"unique-temp-dir": "^1.0.0",
|
|
134
|
-
"update-notifier": "^3.0.
|
|
131
|
+
"update-notifier": "^3.0.1",
|
|
135
132
|
"write-file-atomic": "^3.0.0"
|
|
136
133
|
},
|
|
137
134
|
"devDependencies": {
|
|
135
|
+
"@types/node": "^10.14.18",
|
|
138
136
|
"cli-table3": "^0.5.1",
|
|
139
|
-
"
|
|
140
|
-
"
|
|
141
|
-
"execa": "^1.0.0",
|
|
137
|
+
"delay": "^4.3.0",
|
|
138
|
+
"execa": "^2.0.4",
|
|
142
139
|
"get-stream": "^5.1.0",
|
|
143
140
|
"git-branch": "^2.0.1",
|
|
144
|
-
"has-ansi": "^
|
|
145
|
-
"lolex": "^4.0
|
|
146
|
-
"
|
|
147
|
-
"
|
|
148
|
-
"react": "^16.
|
|
149
|
-
"react-test-renderer": "^16.8.6",
|
|
141
|
+
"has-ansi": "^4.0.0",
|
|
142
|
+
"lolex": "^4.2.0",
|
|
143
|
+
"proxyquire": "^2.1.3",
|
|
144
|
+
"react": "^16.9.0",
|
|
145
|
+
"react-test-renderer": "^16.9.0",
|
|
150
146
|
"replace-string": "^3.0.0",
|
|
151
147
|
"signal-exit": "^3.0.0",
|
|
152
|
-
"sinon": "^7.
|
|
148
|
+
"sinon": "^7.4.2",
|
|
153
149
|
"source-map-fixtures": "^2.1.0",
|
|
154
|
-
"tap": "^
|
|
150
|
+
"tap": "^14.6.4",
|
|
155
151
|
"temp-write": "^4.0.0",
|
|
156
152
|
"touch": "^3.1.0",
|
|
157
|
-
"ts-node": "^8.
|
|
158
|
-
"typescript": "^3.
|
|
153
|
+
"ts-node": "^8.3.0",
|
|
154
|
+
"typescript": "^3.6.3",
|
|
159
155
|
"xo": "^0.24.0",
|
|
160
156
|
"zen-observable": "^0.8.14"
|
|
161
157
|
},
|
|
@@ -166,8 +162,7 @@
|
|
|
166
162
|
"test/fixture/{source-map-initial,syntax-error}.js",
|
|
167
163
|
"test/fixture/snapshots/test-sourcemaps/build/**",
|
|
168
164
|
"test/fixture/power-assert.js",
|
|
169
|
-
"**/*.ts"
|
|
170
|
-
"test/flow-types/*"
|
|
165
|
+
"**/*.ts"
|
|
171
166
|
],
|
|
172
167
|
"rules": {
|
|
173
168
|
"no-use-extend-native/no-use-extend-native": "off"
|
|
@@ -181,11 +176,23 @@
|
|
|
181
176
|
}
|
|
182
177
|
]
|
|
183
178
|
},
|
|
184
|
-
"
|
|
185
|
-
"
|
|
179
|
+
"tap": {
|
|
180
|
+
"browser": false,
|
|
181
|
+
"coverage-report": [
|
|
186
182
|
"html",
|
|
187
183
|
"lcov",
|
|
188
184
|
"text"
|
|
189
|
-
]
|
|
185
|
+
],
|
|
186
|
+
"esm": false,
|
|
187
|
+
"files": [
|
|
188
|
+
"test/*.js",
|
|
189
|
+
"test/reporters/*.js",
|
|
190
|
+
"test/integration/*.js"
|
|
191
|
+
],
|
|
192
|
+
"flow": false,
|
|
193
|
+
"jobs": 2,
|
|
194
|
+
"jsx": false,
|
|
195
|
+
"timeout": 300,
|
|
196
|
+
"ts": false
|
|
190
197
|
}
|
|
191
198
|
}
|
package/profile.js
CHANGED
|
@@ -32,11 +32,13 @@ function resolveModules(modules) {
|
|
|
32
32
|
|
|
33
33
|
Promise.longStackTraces();
|
|
34
34
|
|
|
35
|
-
const conf = loadConfig(
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
const conf = loadConfig({
|
|
36
|
+
defaults: {
|
|
37
|
+
babel: {
|
|
38
|
+
testOptions: {}
|
|
39
|
+
},
|
|
40
|
+
compileEnhancements: true
|
|
41
|
+
}
|
|
40
42
|
});
|
|
41
43
|
|
|
42
44
|
const {projectDir} = conf;
|
|
@@ -143,6 +145,7 @@ runStatus.observeWorker({
|
|
|
143
145
|
}, file);
|
|
144
146
|
|
|
145
147
|
reporter.startRun({
|
|
148
|
+
experiments: [],
|
|
146
149
|
failFastEnabled: false,
|
|
147
150
|
files: [file],
|
|
148
151
|
matching: false,
|
package/readme.md
CHANGED
|
@@ -22,7 +22,7 @@ Translations: [Español](https://github.com/avajs/ava-docs/blob/master/es_ES/rea
|
|
|
22
22
|
- Runs tests concurrently
|
|
23
23
|
- Enforces writing atomic tests
|
|
24
24
|
- No implicit globals
|
|
25
|
-
- Includes TypeScript
|
|
25
|
+
- Includes TypeScript definitions
|
|
26
26
|
- [Magic assert](#magic-assert)
|
|
27
27
|
- [Isolated environment for each test file](./docs/01-writing-tests.md#process-isolation)
|
|
28
28
|
- [Write your tests using the latest JavaScript syntax](#latest-javascript-support)
|
|
@@ -125,7 +125,7 @@ AVA automatically removes unrelated lines in stack traces, allowing you to find
|
|
|
125
125
|
|
|
126
126
|
AVA uses [Babel 7](https://babeljs.io) so you can use the latest JavaScript syntax in your tests. There is no extra setup required. You don't need to be using Babel in your own project for this to work either.
|
|
127
127
|
|
|
128
|
-
We aim support all [finished syntax proposals](https://github.com/tc39/proposals/blob/master/finished-proposals.md), as well as all syntax from ratified JavaScript versions (e.g. ES2017). See our [`@ava/stage-4`](https://github.com/avajs/babel-preset-stage-4) preset for the currently supported proposals.
|
|
128
|
+
We aim to support all [finished syntax proposals](https://github.com/tc39/proposals/blob/master/finished-proposals.md), as well as all syntax from ratified JavaScript versions (e.g. ES2017). See our [`@ava/stage-4`](https://github.com/avajs/babel-preset-stage-4) preset for the currently supported proposals.
|
|
129
129
|
|
|
130
130
|
Please note that we do not add or modify built-ins. For example, if you use [`Object.fromEntries()`](https://github.com/tc39/proposal-object-from-entries) in your tests, they will crash in Node.js 10 which does not implement this method.
|
|
131
131
|
|
|
@@ -168,6 +168,7 @@ We have a growing list of [common pitfalls](docs/08-common-pitfalls.md) you may
|
|
|
168
168
|
- [Testing Vue.js components](docs/recipes/vue.md)
|
|
169
169
|
- [JSPM and SystemJS](docs/recipes/jspm-systemjs.md)
|
|
170
170
|
- [Debugging tests with Chrome DevTools](docs/recipes/debugging-with-chrome-devtools.md)
|
|
171
|
+
- [Debugging tests with VSCode](docs/recipes/debugging-with-vscode.md)
|
|
171
172
|
- [Debugging tests with WebStorm](docs/recipes/debugging-with-webstorm.md)
|
|
172
173
|
- [Isolated MongoDB integration tests](docs/recipes/isolated-mongodb-integration-tests.md)
|
|
173
174
|
- [Testing web apps using Puppeteer](docs/recipes/puppeteer.md)
|
|
@@ -215,6 +216,7 @@ It's the [Andromeda galaxy](https://simple.wikipedia.org/wiki/Andromeda_galaxy).
|
|
|
215
216
|
- [AVA stickers, t-shirts, etc](https://www.redbubble.com/people/sindresorhus/works/30330590-ava-logo)
|
|
216
217
|
- [Awesome list](https://github.com/avajs/awesome-ava)
|
|
217
218
|
- [AVA Casts](http://avacasts.com)
|
|
219
|
+
- [Do you like AVA? Donate here!](https://opencollective.com/ava)
|
|
218
220
|
- [More…](https://github.com/avajs/awesome-ava)
|
|
219
221
|
|
|
220
222
|
## Team
|