ava 3.8.2 → 3.9.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.
@@ -30,7 +30,7 @@ function dumpError(error) {
30
30
  }
31
31
 
32
32
  if (error.values.length > 0) {
33
- object.values = error.values.reduce((acc, value) => {
33
+ object.values = error.values.reduce((acc, value) => { // eslint-disable-line unicorn/no-reduce
34
34
  acc[value.label] = stripAnsi(value.formatted);
35
35
  return acc;
36
36
  }, {});
package/lib/runner.js CHANGED
@@ -241,7 +241,7 @@ class Runner extends Emittery {
241
241
  };
242
242
 
243
243
  let waitForSerial = Promise.resolve();
244
- await runnables.reduce((previous, runnable) => {
244
+ await runnables.reduce((previous, runnable) => { // eslint-disable-line unicorn/no-reduce
245
245
  if (runnable.metadata.serial || this.serial) {
246
246
  waitForSerial = previous.then(() => {
247
247
  // Serial runnables run as long as there was no previous failure, unless
@@ -451,7 +451,7 @@ class Runner extends Emittery {
451
451
  return false;
452
452
  }
453
453
 
454
- return serialTests.reduce(async (previous, task) => {
454
+ return serialTests.reduce(async (previous, task) => { // eslint-disable-line unicorn/no-reduce
455
455
  const previousOk = await previous;
456
456
  // Don't start tests after an interrupt.
457
457
  if (this.interrupted) {
package/lib/test.js CHANGED
@@ -39,7 +39,8 @@ class ExecutionContext extends assert.Assertions {
39
39
  compareWithSnapshot: options => {
40
40
  return test.compareWithSnapshot(options);
41
41
  },
42
- powerAssert: test.powerAssert
42
+ powerAssert: test.powerAssert,
43
+ experiments: test.experiments
43
44
  });
44
45
  testMap.set(this, test);
45
46
 
@@ -482,7 +483,13 @@ class Test {
482
483
  }
483
484
 
484
485
  async runTeardowns() {
485
- for (const teardown of this.teardowns) {
486
+ const teardowns = [...this.teardowns];
487
+
488
+ if (this.experiments.reverseTeardowns) {
489
+ teardowns.reverse();
490
+ }
491
+
492
+ for (const teardown of teardowns) {
486
493
  try {
487
494
  await teardown(); // eslint-disable-line no-await-in-loop
488
495
  } catch (error) {
@@ -196,7 +196,7 @@ ipc.options.then(async options => {
196
196
  if (Reflect.has(mod, Symbol.for('esm:package'))) {
197
197
  requireFn = mod(module);
198
198
  }
199
- } catch (_) {}
199
+ } catch {}
200
200
  }
201
201
 
202
202
  // Install dependency tracker after the require configuration has been evaluated
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "ava",
3
- "version": "3.8.2",
3
+ "version": "3.9.0",
4
4
  "description": "Node.js test runner that lets you develop with confidence.",
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": ">=10.18.0 <11 || >=12.14.0 <12.16.0 || >=12.16.0 <13 || >=13.5.0 <14 || >=14.0.0"
10
+ "node": ">=10.18.0 <11 || >=12.14.0 <12.17.0 || >=12.17.0 <13 || >=14.0.0"
11
11
  },
12
12
  "scripts": {
13
13
  "test": "xo && tsd && c8 --report=none tap && c8 --report=none --no-clean test-ava && c8 report"
@@ -56,13 +56,13 @@
56
56
  ],
57
57
  "dependencies": {
58
58
  "@concordance/react": "^2.0.0",
59
- "acorn": "^7.1.1",
59
+ "acorn": "^7.3.1",
60
60
  "acorn-walk": "^7.1.1",
61
61
  "ansi-styles": "^4.2.1",
62
62
  "arrgv": "^1.0.2",
63
63
  "arrify": "^2.0.1",
64
64
  "callsites": "^3.1.0",
65
- "chalk": "^4.0.0",
65
+ "chalk": "^4.1.0",
66
66
  "chokidar": "^3.4.0",
67
67
  "chunkd": "^2.0.1",
68
68
  "ci-info": "^2.0.0",
@@ -72,16 +72,16 @@
72
72
  "cli-truncate": "^2.1.0",
73
73
  "code-excerpt": "^2.1.1",
74
74
  "common-path-prefix": "^3.0.0",
75
- "concordance": "^4.0.0",
75
+ "concordance": "^5.0.0",
76
76
  "convert-source-map": "^1.7.0",
77
77
  "currently-unhandled": "^0.4.1",
78
78
  "debug": "^4.1.1",
79
79
  "del": "^5.1.0",
80
- "emittery": "^0.6.0",
80
+ "emittery": "^0.7.0",
81
81
  "equal-length": "^1.0.0",
82
82
  "figures": "^3.2.0",
83
- "globby": "^11.0.0",
84
- "ignore-by-default": "^1.0.0",
83
+ "globby": "^11.0.1",
84
+ "ignore-by-default": "^2.0.0",
85
85
  "import-local": "^3.0.2",
86
86
  "indent-string": "^4.0.0",
87
87
  "is-error": "^2.2.2",
@@ -114,19 +114,19 @@
114
114
  "devDependencies": {
115
115
  "@ava/babel": "^1.0.1",
116
116
  "@ava/test": "github:avajs/test",
117
- "@babel/plugin-proposal-do-expressions": "^7.8.3",
117
+ "@babel/plugin-proposal-do-expressions": "^7.10.1",
118
118
  "@sinonjs/fake-timers": "^6.0.1",
119
119
  "ansi-escapes": "^4.3.1",
120
- "c8": "^7.1.2",
120
+ "c8": "^7.2.0",
121
121
  "delay": "^4.3.0",
122
122
  "esm": "^3.2.25",
123
- "execa": "^4.0.0",
123
+ "execa": "^4.0.2",
124
124
  "get-stream": "^5.1.0",
125
- "p-event": "^4.1.0",
125
+ "p-event": "^4.2.0",
126
126
  "proxyquire": "^2.1.3",
127
127
  "react": "^16.13.1",
128
128
  "react-test-renderer": "^16.13.1",
129
- "replace-string": "^3.0.0",
129
+ "replace-string": "^3.1.0",
130
130
  "sinon": "^9.0.2",
131
131
  "source-map-fixtures": "^2.1.0",
132
132
  "tap": "^14.10.7",
@@ -134,8 +134,8 @@
134
134
  "tempy": "^0.5.0",
135
135
  "touch": "^3.1.0",
136
136
  "tsd": "^0.11.0",
137
- "typescript": "^3.8.3",
138
- "xo": "^0.30.0",
137
+ "typescript": "^3.9.5",
138
+ "xo": "^0.32.0",
139
139
  "zen-observable": "^0.8.15"
140
140
  }
141
141
  }