From 5dd22c96324f527260840e26fce8100d9a37a309 Mon Sep 17 00:00:00 2001 From: Mark Wubben Date: Sat, 6 Feb 2021 16:01:58 +0100 Subject: [PATCH] Target Node.js 12.20, 14.15 and 15 --- .github/workflows/ci.yml | 10 +- ava.config.js | 11 +- eslint-plugin-helper.js | 1 + lib/cli.js | 13 +- lib/plugin-support/shared-workers.js | 7 +- lib/worker/plugin.js | 6 - package.json | 2 +- test-tap/integration/assorted.js | 28 +- test-tap/reporters/mini.edgecases.v10.log | 54 -- test-tap/reporters/mini.failfast.v10.log | 26 - test-tap/reporters/mini.failfast2.v10.log | 26 - test-tap/reporters/mini.js | 5 - test-tap/reporters/mini.only.v10.log | 15 - test-tap/reporters/mini.regular.v10.log | 536 ------------------ test-tap/reporters/mini.watch.v10.log | 45 -- test-tap/reporters/tap.edgecases.v10.log | 33 -- test-tap/reporters/tap.failfast.v10.log | 17 - test-tap/reporters/tap.failfast2.v10.log | 19 - test-tap/reporters/tap.only.v10.log | 13 - test-tap/reporters/tap.regular.v10.log | 308 ---------- test-tap/reporters/verbose.edgecases.v10.log | 47 -- test-tap/reporters/verbose.failfast.v10.log | 24 - test-tap/reporters/verbose.failfast2.v10.log | 24 - test-tap/reporters/verbose.only.v10.log | 10 - test-tap/reporters/verbose.regular.v10.log | 444 --------------- .../verbose.timeoutinmultiplefiles.v10.log | 33 -- .../verbose.timeoutinsinglefile.v10.log | 19 - .../verbose.timeoutwithmatch.v10.log | 17 - test-tap/reporters/verbose.watch.v10.log | 32 -- test/config/integration.js | 16 +- test/helpers/exec.js | 9 +- .../requires-newish-node/fixtures/_worker.js | 3 - .../fixtures/package.json | 7 - .../requires-newish-node/fixtures/test.js | 10 - .../requires-newish-node/test.js | 17 - 35 files changed, 29 insertions(+), 1858 deletions(-) delete mode 100644 test-tap/reporters/mini.edgecases.v10.log delete mode 100644 test-tap/reporters/mini.failfast.v10.log delete mode 100644 test-tap/reporters/mini.failfast2.v10.log delete mode 100644 test-tap/reporters/mini.only.v10.log delete mode 100644 test-tap/reporters/mini.regular.v10.log delete mode 100644 test-tap/reporters/mini.watch.v10.log delete mode 100644 test-tap/reporters/tap.edgecases.v10.log delete mode 100644 test-tap/reporters/tap.failfast.v10.log delete mode 100644 test-tap/reporters/tap.failfast2.v10.log delete mode 100644 test-tap/reporters/tap.only.v10.log delete mode 100644 test-tap/reporters/tap.regular.v10.log delete mode 100644 test-tap/reporters/verbose.edgecases.v10.log delete mode 100644 test-tap/reporters/verbose.failfast.v10.log delete mode 100644 test-tap/reporters/verbose.failfast2.v10.log delete mode 100644 test-tap/reporters/verbose.only.v10.log delete mode 100644 test-tap/reporters/verbose.regular.v10.log delete mode 100644 test-tap/reporters/verbose.timeoutinmultiplefiles.v10.log delete mode 100644 test-tap/reporters/verbose.timeoutinsinglefile.v10.log delete mode 100644 test-tap/reporters/verbose.timeoutwithmatch.v10.log delete mode 100644 test-tap/reporters/verbose.watch.v10.log delete mode 100644 test/shared-workers/requires-newish-node/fixtures/_worker.js delete mode 100644 test/shared-workers/requires-newish-node/fixtures/package.json delete mode 100644 test/shared-workers/requires-newish-node/fixtures/test.js delete mode 100644 test/shared-workers/requires-newish-node/test.js diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4320f704b..2b18e7793 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,7 @@ jobs: strategy: fail-fast: false matrix: - node-version: [^10.18.0, ^12.14.0, ^14.0.0, ^15.0.0] + node-version: [^12.20, ^14.15, ^15] os: [ubuntu-latest, windows-latest] steps: - uses: actions/checkout@v2 @@ -48,7 +48,7 @@ jobs: fetch-depth: 1 - uses: actions/setup-node@v2 with: - node-version: ^12 + node-version: ^12.20 - run: npm ci --no-audit - run: npm i typescript@${TS_VERSION} env: @@ -65,7 +65,7 @@ jobs: fetch-depth: 1 - uses: actions/setup-node@v2 with: - node-version: ^12.14.0 + node-version: ^12.20 - name: Upgrade npm run: if [[ "$(npm -v)" != "6.14.10" ]]; then npm install --global npm@6.14.10; fi - run: npm ci --no-audit @@ -88,7 +88,7 @@ jobs: fetch-depth: 1 - uses: actions/setup-node@v2 with: - node-version: ^12.14.0 + node-version: ^12.20 - run: npm install --no-shrinkwrap --no-audit - run: npm run cover @@ -101,6 +101,6 @@ jobs: fetch-depth: 1 - uses: actions/setup-node@v2 with: - node-version: ^10.18.0 + node-version: ^12.20 - run: npm ci - run: npx xo diff --git a/ava.config.js b/ava.config.js index 969924dd0..363e4279f 100644 --- a/ava.config.js +++ b/ava.config.js @@ -1,13 +1,4 @@ -const skipTests = []; -if (process.versions.node < '12.17.0') { - skipTests.push( - '!test/config/next-gen.js', - '!test/configurable-module-format/module.js', - '!test/shared-workers/!(requires-newish-node)/**' - ); -} - export default { - files: ['test/**', '!test/**/{fixtures,helpers}/**', ...skipTests], + files: ['test/**', '!test/**/{fixtures,helpers}/**'], ignoredByWatcher: ['{coverage,docs,media,test-d,test-tap}/**'] }; diff --git a/eslint-plugin-helper.js b/eslint-plugin-helper.js index b8e4a71ec..aaeca0121 100644 --- a/eslint-plugin-helper.js +++ b/eslint-plugin-helper.js @@ -1,4 +1,5 @@ 'use strict'; +// TODO: Clean up. let isMainThread = true; let supportsWorkers = false; try { diff --git a/lib/cli.js b/lib/cli.js index e591a6643..d622c3865 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -428,16 +428,9 @@ exports.run = async () => { // eslint-disable-line complexity const {controlFlow} = require('./ipc-flow-control'); const bufferedSend = controlFlow(process); - if (process.versions.node >= '12.16.0') { - plan.status.on('stateChange', evt => { - bufferedSend(evt); - }); - } else { - const v8 = require('v8'); - plan.status.on('stateChange', evt => { - bufferedSend([...v8.serialize(evt)]); - }); - } + plan.status.on('stateChange', evt => { + bufferedSend(evt); + }); } plan.status.on('stateChange', evt => { diff --git a/lib/plugin-support/shared-workers.js b/lib/plugin-support/shared-workers.js index 5e7ba41e6..23751837e 100644 --- a/lib/plugin-support/shared-workers.js +++ b/lib/plugin-support/shared-workers.js @@ -1,10 +1,7 @@ const events = require('events'); -const serializeError = require('../serialize-error'); +const {Worker} = require('worker_threads'); -let Worker; -try { - ({Worker} = require('worker_threads')); -} catch {} +const serializeError = require('../serialize-error'); const LOADER = require.resolve('./shared-worker-loader'); diff --git a/lib/worker/plugin.js b/lib/worker/plugin.js index 2e8e94b88..3216eb1dc 100644 --- a/lib/worker/plugin.js +++ b/lib/worker/plugin.js @@ -72,8 +72,6 @@ function createSharedWorker(filename, initialData, teardown) { }; } -const supportsSharedWorkers = process.versions.node >= '12.17.0'; - function registerSharedWorker({ filename, initialData, @@ -84,10 +82,6 @@ function registerSharedWorker({ throw new Error('Shared workers are experimental. Opt in to them in your AVA configuration'); } - if (!supportsSharedWorkers) { - throw new Error('Shared workers require Node.js 12.17 or newer'); - } - if (!supportedProtocols.includes('experimental')) { throw new Error(`This version of AVA (${pkg.version}) does not support any of the desired shared worker protocols: ${supportedProtocols.join()}`); } diff --git a/package.json b/package.json index 1bc229c7c..6b0e10227 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "homepage": "https://avajs.dev", "bin": "cli.js", "engines": { - "node": ">=10.18.0 <11 || >=12.14.0 <12.17.0 || >=12.17.0 <13 || >=14.0.0 <15 || >=15" + "node": ">=12.20 <13 || >=14.15 <15 || >=15" }, "scripts": { "cover": "c8 --report=none tap && c8 --report=none --no-clean test-ava && c8 report", diff --git a/test-tap/integration/assorted.js b/test-tap/integration/assorted.js index 53dd2630a..d94161ae0 100644 --- a/test-tap/integration/assorted.js +++ b/test-tap/integration/assorted.js @@ -164,30 +164,18 @@ test('selects .cjs test files', t => { }); }); -test('load .mjs test files (when node supports it)', t => { +test('load .mjs test files', t => { execCli('mjs.mjs', (err, stdout) => { - if (Number.parseFloat(process.version.slice(1)) >= 12.17) { - t.ifError(err); - t.match(stdout, /1 test passed/); - t.end(); - } else { - t.ok(err); - t.match(stdout, /ECMAScript Modules are not supported in this Node.js version./); - t.end(); - } + t.ifError(err); + t.match(stdout, /1 test passed/); + t.end(); }); }); -test('load .js test files as ESM modules (when node supports it)', t => { +test('load .js test files as ESM modules', t => { execCli('test.js', {dirname: 'fixture/pkg-type-module'}, (err, stdout) => { - if (Number.parseFloat(process.version.slice(1)) >= 12.17) { - t.ifError(err); - t.match(stdout, /1 test passed/); - t.end(); - } else { - t.ok(err); - t.match(stdout, /ECMAScript Modules are not supported in this Node.js version./); - t.end(); - } + t.ifError(err); + t.match(stdout, /1 test passed/); + t.end(); }); }); diff --git a/test-tap/reporters/mini.edgecases.v10.log b/test-tap/reporters/mini.edgecases.v10.log deleted file mode 100644 index e3e8c408d..000000000 --- a/test-tap/reporters/mini.edgecases.v10.log +++ /dev/null @@ -1,54 +0,0 @@ -[?25l---tty-stream-chunk-separator - ----tty-stream-chunk-separator -* ---tty-stream-chunk-separator ----tty-stream-chunk-separator -* ⚠ Could not parse ast-syntax-error.js for line number selection---tty-stream-chunk-separator ----tty-stream-chunk-separator -* ✖ Line numbers for ast-syntax-error.js did not match any tests---tty-stream-chunk-separator ----tty-stream-chunk-separator -* ✖ No tests found in ava-import-no-test-declaration.js---tty-stream-chunk-separator ----tty-stream-chunk-separator -* ✖ No tests found in no-ava-import.js, make sure to import "ava" at the top of your test file---tty-stream-chunk-separator ----tty-stream-chunk-separator -* ✖ Line numbers for test.js did not match any tests---tty-stream-chunk-separator ----tty-stream-chunk-separator -[?25h ✖ No tests found in no-ava-import.js, make sure to import "ava" at the top of your test file - ✖ No tests found in ava-import-no-test-declaration.js - ✖ No tests found in import-and-use-test-member.js - ✖ No tests found in throws.js - ⚠ Could not parse ast-syntax-error.js for line number selection - ✖ Line numbers for ast-syntax-error.js did not match any tests - ✖ Line numbers for test.js did not match any tests - - ─ - - Uncaught exception in import-and-use-test-member.js - - import-and-use-test-member.js:3 - - 2: -  3: test('pass', t => t.pass()); - 4: - - TypeError: test is not a function - - › Object. (test-tap/fixture/report/edgecases/import-and-use-test-member.js:3:1) - - - - Uncaught exception in throws.js - - throws.js:1 - -  1: throw new Error('throws'); - 2: - - Error: throws - - › Object. (test-tap/fixture/report/edgecases/throws.js:1:7) - - ─ - - 2 uncaught exceptions ----tty-stream-chunk-separator diff --git a/test-tap/reporters/mini.failfast.v10.log b/test-tap/reporters/mini.failfast.v10.log deleted file mode 100644 index b27400463..000000000 --- a/test-tap/reporters/mini.failfast.v10.log +++ /dev/null @@ -1,26 +0,0 @@ -[?25l---tty-stream-chunk-separator - ----tty-stream-chunk-separator -* ---tty-stream-chunk-separator ----tty-stream-chunk-separator -* a › fails - - 1 test failed---tty-stream-chunk-separator ----tty-stream-chunk-separator -[?25h a › fails - - a.js:3 - - 2: -  3: test('fails', t => t.fail()); - 4: - - Test failed via `t.fail()` - - › t (test-tap/fixture/report/failfast/a.js:3:22) - - ─ - - `--fail-fast` is on. 1 test file was skipped. - 1 test failed ----tty-stream-chunk-separator diff --git a/test-tap/reporters/mini.failfast2.v10.log b/test-tap/reporters/mini.failfast2.v10.log deleted file mode 100644 index 5045b56f7..000000000 --- a/test-tap/reporters/mini.failfast2.v10.log +++ /dev/null @@ -1,26 +0,0 @@ -[?25l---tty-stream-chunk-separator - ----tty-stream-chunk-separator -* ---tty-stream-chunk-separator ----tty-stream-chunk-separator -* a › fails - - 1 test failed---tty-stream-chunk-separator ----tty-stream-chunk-separator -[?25h a › fails - - a.js:3 - - 2: -  3: test('fails', t => t.fail());  - 4: test('passes', t => t.pass()); - - Test failed via `t.fail()` - - › t (test-tap/fixture/report/failfast2/a.js:3:22) - - ─ - - `--fail-fast` is on. At least 1 test was skipped, as well as 1 test file. - 1 test failed ----tty-stream-chunk-separator diff --git a/test-tap/reporters/mini.js b/test-tap/reporters/mini.js index 0c541157b..effe5a922 100644 --- a/test-tap/reporters/mini.js +++ b/test-tap/reporters/mini.js @@ -1,11 +1,6 @@ 'use strict'; require('../helper/fix-reporter-env')(); -// Excessive writes occur in Node.js 11. These don't have a visual impact but prevent the integration tests from passing. -if (process.version.startsWith('v11')) { - process.exit(0); // eslint-disable-line unicorn/no-process-exit -} - const path = require('path'); const {test} = require('tap'); const TTYStream = require('../helper/tty-stream'); diff --git a/test-tap/reporters/mini.only.v10.log b/test-tap/reporters/mini.only.v10.log deleted file mode 100644 index cef90482b..000000000 --- a/test-tap/reporters/mini.only.v10.log +++ /dev/null @@ -1,15 +0,0 @@ -[?25l---tty-stream-chunk-separator - ----tty-stream-chunk-separator -* ---tty-stream-chunk-separator ----tty-stream-chunk-separator -* a › only - - 1 passed---tty-stream-chunk-separator ----tty-stream-chunk-separator -* b › passes - - 2 passed---tty-stream-chunk-separator ----tty-stream-chunk-separator -[?25h 2 tests passed ----tty-stream-chunk-separator diff --git a/test-tap/reporters/mini.regular.v10.log b/test-tap/reporters/mini.regular.v10.log deleted file mode 100644 index 6659758ae..000000000 --- a/test-tap/reporters/mini.regular.v10.log +++ /dev/null @@ -1,536 +0,0 @@ -[?25l---tty-stream-chunk-separator - ----tty-stream-chunk-separator -* ---tty-stream-chunk-separator ----tty-stream-chunk-separator -* nested-objects › format with max depth 4 - - 1 test failed---tty-stream-chunk-separator ----tty-stream-chunk-separator -* nested-objects › format like with max depth 4 - - 2 tests failed---tty-stream-chunk-separator ----tty-stream-chunk-separator -* output-in-hook › passing test - - 1 passed - 2 tests failed---tty-stream-chunk-separator ----tty-stream-chunk-separator -* output-in-hook › failing test - - 1 passed - 3 tests failed---tty-stream-chunk-separator ----tty-stream-chunk-separator -* test › passes - - 2 passed - 3 tests failed - 1 skipped - 1 todo---tty-stream-chunk-separator ----tty-stream-chunk-separator -* test › fails - - 2 passed - 4 tests failed - 1 skipped - 1 todo---tty-stream-chunk-separator ----tty-stream-chunk-separator -* test › known failure - - 2 passed - 1 known failure - 4 tests failed - 1 skipped - 1 todo---tty-stream-chunk-separator ----tty-stream-chunk-separator -* test › no longer failing - - 2 passed - 1 known failure - 5 tests failed - 1 skipped - 1 todo---tty-stream-chunk-separator ----tty-stream-chunk-separator -* test › logs - - 2 passed - 1 known failure - 6 tests failed - 1 skipped - 1 todo---tty-stream-chunk-separator ----tty-stream-chunk-separator -* test › formatted - - 2 passed - 1 known failure - 7 tests failed - 1 skipped - 1 todo---tty-stream-chunk-separator ----tty-stream-chunk-separator -* test › power-assert - - 2 passed - 1 known failure - 8 tests failed - 1 skipped - 1 todo---tty-stream-chunk-separator ----tty-stream-chunk-separator -* test › bad throws - - 2 passed - 1 known failure - 9 tests failed - 1 skipped - 1 todo---tty-stream-chunk-separator ----tty-stream-chunk-separator -* test › bad notThrows - - 2 passed - 1 known failure - 10 tests failed - 1 skipped - 1 todo---tty-stream-chunk-separator ----tty-stream-chunk-separator -* test › implementation throws non-error - - 2 passed - 1 known failure - 11 tests failed - 1 skipped - 1 todo---tty-stream-chunk-separator ----tty-stream-chunk-separator -* traces-in-t-throws › throws - - 2 passed - 1 known failure - 12 tests failed - 1 skipped - 1 todo---tty-stream-chunk-separator ----tty-stream-chunk-separator -* traces-in-t-throws › notThrows - - 2 passed - 1 known failure - 13 tests failed - 1 skipped - 1 todo---tty-stream-chunk-separator ----tty-stream-chunk-separator -* traces-in-t-throws › notThrowsAsync - - 2 passed - 1 known failure - 14 tests failed - 1 skipped - 1 todo---tty-stream-chunk-separator ----tty-stream-chunk-separator -* traces-in-t-throws › throwsAsync - - 2 passed - 1 known failure - 15 tests failed - 1 skipped - 1 todo---tty-stream-chunk-separator ----tty-stream-chunk-separator -* traces-in-t-throws › throwsAsync different error - - 2 passed - 1 known failure - 16 tests failed - 1 skipped - 1 todo---tty-stream-chunk-separator ----tty-stream-chunk-separator -* uncaught-exception › passes - - 3 passed - 1 known failure - 16 tests failed - 1 skipped - 1 todo---tty-stream-chunk-separator ----tty-stream-chunk-separator -* unhandled-rejection › passes - - 4 passed - 1 known failure - 16 tests failed - 1 skipped - 1 todo---tty-stream-chunk-separator ----tty-stream-chunk-separator -* unhandled-rejection › unhandled non-error rejection - - 5 passed - 1 known failure - 16 tests failed - 1 skipped - 1 todo---tty-stream-chunk-separator ----tty-stream-chunk-separator -[?25h ✖ No tests found in bad-test-chain.js - - ─ - - nested-objects › format with max depth 4 - - nested-objects.js:28 - - 27: }; -  28: t.deepEqual(exp, act); - 29: }); - - Difference: - - { - a: { - b: { - foo: 'bar', - }, - }, - + c: { - + d: { - + e: { - + foo: 'bar', - + }, - + }, - + }, - } - - › t (test-tap/fixture/report/regular/nested-objects.js:28:4) - - - - nested-objects › format like with max depth 4 - - nested-objects.js:54 - - 53: }; -  54: t.like(actual, pattern); - 55: }); - - Difference: - - { - a: { - b: { - - foo: 'bar', - + foo: 'qux', - }, - }, - } - - › t (test-tap/fixture/report/regular/nested-objects.js:54:4) - - - - output-in-hook › failing test - - output-in-hook.js:34 - - 33: test('failing test', t => { -  34: t.fail();  - 35: }); - - Test failed via `t.fail()` - - › t (test-tap/fixture/report/regular/output-in-hook.js:34:4) - - - - test › fails - - test.js:9 - - 8: -  9: test('fails', t => t.fail()); - 10: - - Test failed via `t.fail()` - - › t (test-tap/fixture/report/regular/test.js:9:22) - - - - test › no longer failing - - Error: Test was expected to fail, but succeeded, you should stop marking the test as failing - - - - test › logs - - ℹ hello - ℹ world - - test.js:18 - - 17: t.log('world'); -  18: t.fail();  - 19: }); - - Test failed via `t.fail()` - - › t (test-tap/fixture/report/regular/test.js:18:4) - - - - test › formatted - - test.js:22 - - 21: test('formatted', t => { -  22: t.deepEqual('foo', 'bar'); - 23: }); - - Difference: - - - 'foo' - + 'bar' - - › t (test-tap/fixture/report/regular/test.js:22:4) - - - - test › power-assert - - test.js:27 - - 26: const foo = ''; -  27: t.assert(foo);  - 28: }); - - Value is not truthy: - - '' - - foo - => '' - - › t (test-tap/fixture/report/regular/test.js:27:4) - - - - test › bad throws - - test.js:35 - - 34: -  35: t.throws(fn()); - 36: }); - - Improper usage of `t.throws()` detected - - The following error was thrown, possibly before `t.throws()` could be called: - - Error { - message: 'err', - } - - Try wrapping the first argument to `t.throws()` in a function: - - t.throws(() => { /* your code here */ }) - - Visit the following URL for more details: - - https://github.com/avajs/ava/blob/v1.0.0-beta.5.1/docs/03-assertions.md#throwsfn-expected-message - - › fn (test-tap/fixture/report/regular/test.js:32:9) - › t (test-tap/fixture/report/regular/test.js:35:11) - - - - test › bad notThrows - - test.js:43 - - 42: -  43: t.notThrows(fn()); - 44: }); - - Improper usage of `t.notThrows()` detected - - The following error was thrown, possibly before `t.notThrows()` could be called: - - Error { - message: 'err', - } - - Try wrapping the first argument to `t.notThrows()` in a function: - - t.notThrows(() => { /* your code here */ }) - - Visit the following URL for more details: - - https://github.com/avajs/ava/blob/v1.0.0-beta.5.1/docs/03-assertions.md#throwsfn-expected-message - - › fn (test-tap/fixture/report/regular/test.js:40:9) - › t (test-tap/fixture/report/regular/test.js:43:14) - - - - test › implementation throws non-error - - Error thrown in test: - - null - - - - traces-in-t-throws › throws - - traces-in-t-throws.js:12 - - 11: test('throws', t => { -  12: t.throws(() => throwError(), {instanceOf: TypeError}); - 13: }); - - Function threw unexpected exception: - - Error { - message: 'uh-oh', - } - - Expected instance of: - - Function TypeError {} - - › throwError (test-tap/fixture/report/regular/traces-in-t-throws.js:4:8) - › t.throws._avaThrowsHelperEnd (test-tap/fixture/report/regular/traces-in-t-throws.js:12:17) - › t (test-tap/fixture/report/regular/traces-in-t-throws.js:12:4) - - - - traces-in-t-throws › notThrows - - traces-in-t-throws.js:16 - - 15: test('notThrows', t => { -  16: t.notThrows(() => throwError()); - 17: }); - - Function threw: - - Error { - message: 'uh-oh', - } - - › throwError (test-tap/fixture/report/regular/traces-in-t-throws.js:4:8) - › t.notThrows._avaThrowsHelperEnd (test-tap/fixture/report/regular/traces-in-t-throws.js:16:20) - › t (test-tap/fixture/report/regular/traces-in-t-throws.js:16:4) - - - - traces-in-t-throws › notThrowsAsync - - traces-in-t-throws.js:20 - - 19: test('notThrowsAsync', t => { -  20: t.notThrowsAsync(() => throwError()); - 21: }); - - Function threw: - - Error { - message: 'uh-oh', - } - - › throwError (test-tap/fixture/report/regular/traces-in-t-throws.js:4:8) - › t.notThrowsAsync (test-tap/fixture/report/regular/traces-in-t-throws.js:20:25) - › t (test-tap/fixture/report/regular/traces-in-t-throws.js:20:4) - - - - traces-in-t-throws › throwsAsync - - traces-in-t-throws.js:24 - - 23: test('throwsAsync', t => { -  24: t.throwsAsync(() => throwError(), {instanceOf: TypeError}); - 25: }); - - Function threw synchronously. Use `t.throws()` instead: - - Error { - message: 'uh-oh', - } - - › throwError (test-tap/fixture/report/regular/traces-in-t-throws.js:4:8) - › t.throwsAsync (test-tap/fixture/report/regular/traces-in-t-throws.js:24:22) - › t (test-tap/fixture/report/regular/traces-in-t-throws.js:24:4) - - - - traces-in-t-throws › throwsAsync different error - - traces-in-t-throws.js:28 - - 27: test('throwsAsync different error', t => { -  28: return t.throwsAsync(returnRejectedPromise, {instanceOf: TypeError}); - 29: }); - - Returned promise rejected with unexpected exception: - - Error { - message: 'uh-oh', - } - - Expected instance of: - - Function TypeError {} - - › returnRejectedPromise (test-tap/fixture/report/regular/traces-in-t-throws.js:8:24) - › t (test-tap/fixture/report/regular/traces-in-t-throws.js:28:11) - - - - Uncaught exception in bad-test-chain.js - - bad-test-chain.js:3 - - 2: -  3: test.serial.test('passes', t => t.pass()); - 4: - - TypeError: test.serial.test is not a function - - › Object. (test-tap/fixture/report/regular/bad-test-chain.js:3:13) - - - - Uncaught exception in uncaught-exception.js - - uncaught-exception.js:5 - - 4: setImmediate(() => { -  5: throw new Error('Can’t catch me'); - 6: }); - - Error: Can’t catch me - - › Immediate.setImmediate (test-tap/fixture/report/regular/uncaught-exception.js:5:9) - - - - Unhandled rejection in unhandled-rejection.js - - unhandled-rejection.js:4 - - 3: const passes = t => { -  4: Promise.reject(new Error('Can’t catch me')); - 5: t.pass(); - - Error: Can’t catch me - - › passes (test-tap/fixture/report/regular/unhandled-rejection.js:4:17) - - - - Unhandled rejection in unhandled-rejection.js - - null - - ─ - - 16 tests failed - 1 known failure - 1 test skipped - 1 test todo - 2 unhandled rejections - 2 uncaught exceptions ----tty-stream-chunk-separator diff --git a/test-tap/reporters/mini.watch.v10.log b/test-tap/reporters/mini.watch.v10.log deleted file mode 100644 index 9879da19c..000000000 --- a/test-tap/reporters/mini.watch.v10.log +++ /dev/null @@ -1,45 +0,0 @@ -[?25l---tty-stream-chunk-separator - ----tty-stream-chunk-separator -* ---tty-stream-chunk-separator ----tty-stream-chunk-separator -* test › passes - - 1 passed [17:19:12]---tty-stream-chunk-separator ----tty-stream-chunk-separator -[?25h 1 test passed [17:19:12] - ----tty-stream-chunk-separator -──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ----tty-stream-chunk-separator -[?25l---tty-stream-chunk-separator - ----tty-stream-chunk-separator -* test › passes - - 1 passed [17:19:12]---tty-stream-chunk-separator ----tty-stream-chunk-separator -* test › passes - - 1 passed [17:19:12]---tty-stream-chunk-separator ----tty-stream-chunk-separator -[?25h 1 test passed [17:19:12] - 2 previous failures in test files that were not rerun - ----tty-stream-chunk-separator -──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ----tty-stream-chunk-separator -[?25l---tty-stream-chunk-separator - ----tty-stream-chunk-separator -* test › passes - - 1 passed [17:19:12]---tty-stream-chunk-separator ----tty-stream-chunk-separator -* test › passes - - 1 passed [17:19:12]---tty-stream-chunk-separator ----tty-stream-chunk-separator -[?25h 1 test passed [17:19:12] - ----tty-stream-chunk-separator diff --git a/test-tap/reporters/tap.edgecases.v10.log b/test-tap/reporters/tap.edgecases.v10.log deleted file mode 100644 index d8e0bf81a..000000000 --- a/test-tap/reporters/tap.edgecases.v10.log +++ /dev/null @@ -1,33 +0,0 @@ -TAP version 13 ----tty-stream-chunk-separator -not ok 1 - No tests found in ava-import-no-test-declaration.js ----tty-stream-chunk-separator -not ok 2 - TypeError: test is not a function - --- - name: TypeError - message: test is not a function - at: >- - Object. - (test-tap/fixture/report/edgecases/import-and-use-test-member.js:3:1) - ... ----tty-stream-chunk-separator -not ok 3 - import-and-use-test-member.js exited with a non-zero exit code: 1 ----tty-stream-chunk-separator -not ok 4 - No tests found in no-ava-import.js, make sure to import "ava" at the top of your test file ----tty-stream-chunk-separator -not ok 5 - Error: throws - --- - name: Error - message: throws - at: 'Object. (test-tap/fixture/report/edgecases/throws.js:1:7)' - ... ----tty-stream-chunk-separator -not ok 6 - throws.js exited with a non-zero exit code: 1 ----tty-stream-chunk-separator - -1..0 -# tests 0 -# pass 0 -# fail 6 - ----tty-stream-chunk-separator diff --git a/test-tap/reporters/tap.failfast.v10.log b/test-tap/reporters/tap.failfast.v10.log deleted file mode 100644 index 612b4bf05..000000000 --- a/test-tap/reporters/tap.failfast.v10.log +++ /dev/null @@ -1,17 +0,0 @@ -TAP version 13 ----tty-stream-chunk-separator -not ok 1 - a › fails - --- - name: AssertionError - message: Test failed via `t.fail()` - assertion: fail - at: 't (test-tap/fixture/report/failfast/a.js:3:22)' - ... ----tty-stream-chunk-separator - -1..1 -# tests 1 -# pass 0 -# fail 1 - ----tty-stream-chunk-separator diff --git a/test-tap/reporters/tap.failfast2.v10.log b/test-tap/reporters/tap.failfast2.v10.log deleted file mode 100644 index f1cc7fd8a..000000000 --- a/test-tap/reporters/tap.failfast2.v10.log +++ /dev/null @@ -1,19 +0,0 @@ -TAP version 13 ----tty-stream-chunk-separator -not ok 1 - a › fails - --- - name: AssertionError - message: Test failed via `t.fail()` - assertion: fail - at: 't (test-tap/fixture/report/failfast2/a.js:3:22)' - ... ----tty-stream-chunk-separator -# 1 test remaining in a.js ----tty-stream-chunk-separator - -1..2 -# tests 2 -# pass 0 -# fail 2 - ----tty-stream-chunk-separator diff --git a/test-tap/reporters/tap.only.v10.log b/test-tap/reporters/tap.only.v10.log deleted file mode 100644 index 36f42b988..000000000 --- a/test-tap/reporters/tap.only.v10.log +++ /dev/null @@ -1,13 +0,0 @@ -TAP version 13 ----tty-stream-chunk-separator -ok 1 - a › only ----tty-stream-chunk-separator -ok 2 - b › passes ----tty-stream-chunk-separator - -1..2 -# tests 2 -# pass 2 -# fail 0 - ----tty-stream-chunk-separator diff --git a/test-tap/reporters/tap.regular.v10.log b/test-tap/reporters/tap.regular.v10.log deleted file mode 100644 index 737f37817..000000000 --- a/test-tap/reporters/tap.regular.v10.log +++ /dev/null @@ -1,308 +0,0 @@ -TAP version 13 ----tty-stream-chunk-separator -not ok 1 - TypeError: test.serial.test is not a function - --- - name: TypeError - message: test.serial.test is not a function - at: 'Object. (test-tap/fixture/report/regular/bad-test-chain.js:3:13)' - ... ----tty-stream-chunk-separator -not ok 2 - bad-test-chain.js exited with a non-zero exit code: 1 ----tty-stream-chunk-separator -not ok 3 - nested-objects › format with max depth 4 - --- - name: AssertionError - assertion: deepEqual - values: - 'Difference:': |2- - { - a: { - b: { - foo: 'bar', - }, - }, - + c: { - + d: { - + e: { - + foo: 'bar', - + }, - + }, - + }, - } - at: 't (test-tap/fixture/report/regular/nested-objects.js:28:4)' - ... ----tty-stream-chunk-separator -not ok 4 - nested-objects › format like with max depth 4 - --- - name: AssertionError - assertion: like - values: - 'Difference:': |2- - { - a: { - b: { - - foo: 'bar', - + foo: 'qux', - }, - }, - } - at: 't (test-tap/fixture/report/regular/nested-objects.js:54:4)' - ... ----tty-stream-chunk-separator -# output-in-hook › before hook ----tty-stream-chunk-separator -# output-in-hook › before hook ----tty-stream-chunk-separator -# before ----tty-stream-chunk-separator -# output-in-hook › beforeEach hook for passing test ----tty-stream-chunk-separator -# beforeEach ----tty-stream-chunk-separator -# output-in-hook › beforeEach hook for failing test ----tty-stream-chunk-separator -# beforeEach ----tty-stream-chunk-separator -ok 5 - output-in-hook › passing test ----tty-stream-chunk-separator -not ok 6 - output-in-hook › failing test - --- - name: AssertionError - message: Test failed via `t.fail()` - assertion: fail - at: 't (test-tap/fixture/report/regular/output-in-hook.js:34:4)' - ... ----tty-stream-chunk-separator -# output-in-hook › afterEach hook for passing test ----tty-stream-chunk-separator -# afterEach ----tty-stream-chunk-separator -# output-in-hook › afterEach.always hook for failing test ----tty-stream-chunk-separator -# afterEachAlways ----tty-stream-chunk-separator -# output-in-hook › afterEach.always hook for passing test ----tty-stream-chunk-separator -# afterEachAlways ----tty-stream-chunk-separator -# output-in-hook › cleanup ----tty-stream-chunk-separator -# afterAlways ----tty-stream-chunk-separator -ok 7 - test › skip # SKIP ----tty-stream-chunk-separator -not ok 8 - test › todo # TODO ----tty-stream-chunk-separator -ok 9 - test › passes ----tty-stream-chunk-separator -not ok 10 - test › fails - --- - name: AssertionError - message: Test failed via `t.fail()` - assertion: fail - at: 't (test-tap/fixture/report/regular/test.js:9:22)' - ... ----tty-stream-chunk-separator -ok 11 - test › known failure ----tty-stream-chunk-separator -not ok 12 - test › no longer failing - --- - name: Error - message: >- - Test was expected to fail, but succeeded, you should stop marking the test as - failing - at: '' - ... ----tty-stream-chunk-separator -not ok 13 - test › logs -# hello -# world - --- - name: AssertionError - message: Test failed via `t.fail()` - assertion: fail - at: 't (test-tap/fixture/report/regular/test.js:18:4)' - ... ----tty-stream-chunk-separator -not ok 14 - test › formatted - --- - name: AssertionError - assertion: deepEqual - values: - 'Difference:': |- - - 'foo' - + 'bar' - at: 't (test-tap/fixture/report/regular/test.js:22:4)' - ... ----tty-stream-chunk-separator -not ok 15 - test › power-assert - --- - name: AssertionError - assertion: assert - operator: '!!' - values: - 'Value is not truthy:': '''''' - at: 't (test-tap/fixture/report/regular/test.js:27:4)' - ... ----tty-stream-chunk-separator -not ok 16 - test › bad throws - --- - name: AssertionError - message: Improper usage of `t.throws()` detected - assertion: throws - values: - 'The following error was thrown, possibly before `t.throws()` could be called:': |- - Error { - message: 'err', - } - at: |- - fn (test-tap/fixture/report/regular/test.js:32:9) - t (test-tap/fixture/report/regular/test.js:35:11) - ... ----tty-stream-chunk-separator -not ok 17 - test › bad notThrows - --- - name: AssertionError - message: Improper usage of `t.notThrows()` detected - assertion: notThrows - values: - 'The following error was thrown, possibly before `t.notThrows()` could be called:': |- - Error { - message: 'err', - } - at: |- - fn (test-tap/fixture/report/regular/test.js:40:9) - t (test-tap/fixture/report/regular/test.js:43:14) - ... ----tty-stream-chunk-separator -not ok 18 - test › implementation throws non-error - --- - name: AssertionError - message: Error thrown in test - values: - 'Error thrown in test:': 'null' - at: '' - ... ----tty-stream-chunk-separator -not ok 19 - traces-in-t-throws › throws - --- - name: AssertionError - assertion: throws - values: - 'Function threw unexpected exception:': |- - Error { - message: 'uh-oh', - } - 'Expected instance of:': 'Function TypeError {}' - at: >- - throwError (test-tap/fixture/report/regular/traces-in-t-throws.js:4:8) - - t.throws._avaThrowsHelperEnd - (test-tap/fixture/report/regular/traces-in-t-throws.js:12:17) - - t (test-tap/fixture/report/regular/traces-in-t-throws.js:12:4) - ... ----tty-stream-chunk-separator -not ok 20 - traces-in-t-throws › notThrows - --- - name: AssertionError - assertion: notThrows - values: - 'Function threw:': |- - Error { - message: 'uh-oh', - } - at: >- - throwError (test-tap/fixture/report/regular/traces-in-t-throws.js:4:8) - - t.notThrows._avaThrowsHelperEnd - (test-tap/fixture/report/regular/traces-in-t-throws.js:16:20) - - t (test-tap/fixture/report/regular/traces-in-t-throws.js:16:4) - ... ----tty-stream-chunk-separator -not ok 21 - traces-in-t-throws › notThrowsAsync - --- - name: AssertionError - assertion: notThrowsAsync - values: - 'Function threw:': |- - Error { - message: 'uh-oh', - } - at: |- - throwError (test-tap/fixture/report/regular/traces-in-t-throws.js:4:8) - t.notThrowsAsync (test-tap/fixture/report/regular/traces-in-t-throws.js:20:25) - t (test-tap/fixture/report/regular/traces-in-t-throws.js:20:4) - ... ----tty-stream-chunk-separator -not ok 22 - traces-in-t-throws › throwsAsync - --- - name: AssertionError - assertion: throwsAsync - values: - 'Function threw synchronously. Use `t.throws()` instead:': |- - Error { - message: 'uh-oh', - } - at: |- - throwError (test-tap/fixture/report/regular/traces-in-t-throws.js:4:8) - t.throwsAsync (test-tap/fixture/report/regular/traces-in-t-throws.js:24:22) - t (test-tap/fixture/report/regular/traces-in-t-throws.js:24:4) - ... ----tty-stream-chunk-separator -not ok 23 - traces-in-t-throws › throwsAsync different error - --- - name: AssertionError - assertion: throwsAsync - values: - 'Returned promise rejected with unexpected exception:': |- - Error { - message: 'uh-oh', - } - 'Expected instance of:': 'Function TypeError {}' - at: >- - returnRejectedPromise - (test-tap/fixture/report/regular/traces-in-t-throws.js:8:24) - - t (test-tap/fixture/report/regular/traces-in-t-throws.js:28:11) - ... ----tty-stream-chunk-separator -ok 24 - uncaught-exception › passes ----tty-stream-chunk-separator -not ok 25 - Error: Can’t catch me - --- - name: Error - message: Can’t catch me - at: >- - Immediate.setImmediate - (test-tap/fixture/report/regular/uncaught-exception.js:5:9) - ... ----tty-stream-chunk-separator -not ok 26 - uncaught-exception.js exited with a non-zero exit code: 1 ----tty-stream-chunk-separator -ok 27 - unhandled-rejection › passes ----tty-stream-chunk-separator -ok 28 - unhandled-rejection › unhandled non-error rejection ----tty-stream-chunk-separator -not ok 29 - Error: Can’t catch me - --- - name: Error - message: Can’t catch me - at: 'passes (test-tap/fixture/report/regular/unhandled-rejection.js:4:17)' - ... ----tty-stream-chunk-separator -not ok 30 - unhandled-rejection - --- - message: Non-error object - formatted: 'null' - ... ----tty-stream-chunk-separator - -1..24 -# tests 23 -# pass 6 -# skip 1 -# fail 23 - ----tty-stream-chunk-separator diff --git a/test-tap/reporters/verbose.edgecases.v10.log b/test-tap/reporters/verbose.edgecases.v10.log deleted file mode 100644 index 8d5fad418..000000000 --- a/test-tap/reporters/verbose.edgecases.v10.log +++ /dev/null @@ -1,47 +0,0 @@ - ----tty-stream-chunk-separator - ⚠ Could not parse ast-syntax-error.js for line number selection ----tty-stream-chunk-separator - ✖ Line numbers for ast-syntax-error.js did not match any tests ----tty-stream-chunk-separator - ✖ No tests found in ava-import-no-test-declaration.js ----tty-stream-chunk-separator - - Uncaught exception in import-and-use-test-member.js - - import-and-use-test-member.js:3 - - 2: -  3: test('pass', t => t.pass()); - 4: - - TypeError: test is not a function - - › Object. (test-tap/fixture/report/edgecases/import-and-use-test-member.js:3:1) - ----tty-stream-chunk-separator - ✖ import-and-use-test-member.js exited with a non-zero exit code: 1 ----tty-stream-chunk-separator - ✖ No tests found in no-ava-import.js, make sure to import "ava" at the top of your test file ----tty-stream-chunk-separator - ✖ Line numbers for test.js did not match any tests ----tty-stream-chunk-separator - - Uncaught exception in throws.js - - throws.js:1 - -  1: throw new Error('throws'); - 2: - - Error: throws - - › Object. (test-tap/fixture/report/edgecases/throws.js:1:7) - ----tty-stream-chunk-separator - ✖ throws.js exited with a non-zero exit code: 1 ----tty-stream-chunk-separator - ─ - - 2 uncaught exceptions ----tty-stream-chunk-separator diff --git a/test-tap/reporters/verbose.failfast.v10.log b/test-tap/reporters/verbose.failfast.v10.log deleted file mode 100644 index a42782962..000000000 --- a/test-tap/reporters/verbose.failfast.v10.log +++ /dev/null @@ -1,24 +0,0 @@ - ----tty-stream-chunk-separator - ✖ a › fails Test failed via `t.fail()` ----tty-stream-chunk-separator - ─ - - a › fails - - a.js:3 - - 2: -  3: test('fails', t => t.fail()); - 4: - - Test failed via `t.fail()` - - › t (test-tap/fixture/report/failfast/a.js:3:22) - - ─ - - `--fail-fast` is on. 1 test file was skipped. - - 1 test failed ----tty-stream-chunk-separator diff --git a/test-tap/reporters/verbose.failfast2.v10.log b/test-tap/reporters/verbose.failfast2.v10.log deleted file mode 100644 index 6c2ff84ed..000000000 --- a/test-tap/reporters/verbose.failfast2.v10.log +++ /dev/null @@ -1,24 +0,0 @@ - ----tty-stream-chunk-separator - ✖ a › fails Test failed via `t.fail()` ----tty-stream-chunk-separator - ─ - - a › fails - - a.js:3 - - 2: -  3: test('fails', t => t.fail());  - 4: test('passes', t => t.pass()); - - Test failed via `t.fail()` - - › t (test-tap/fixture/report/failfast2/a.js:3:22) - - ─ - - `--fail-fast` is on. At least 1 test was skipped, as well as 1 test file. - - 1 test failed ----tty-stream-chunk-separator diff --git a/test-tap/reporters/verbose.only.v10.log b/test-tap/reporters/verbose.only.v10.log deleted file mode 100644 index f01706e56..000000000 --- a/test-tap/reporters/verbose.only.v10.log +++ /dev/null @@ -1,10 +0,0 @@ - ----tty-stream-chunk-separator - ✔ a › only ----tty-stream-chunk-separator - ✔ b › passes ----tty-stream-chunk-separator - ─ - - 2 tests passed ----tty-stream-chunk-separator diff --git a/test-tap/reporters/verbose.regular.v10.log b/test-tap/reporters/verbose.regular.v10.log deleted file mode 100644 index 699ee5fca..000000000 --- a/test-tap/reporters/verbose.regular.v10.log +++ /dev/null @@ -1,444 +0,0 @@ - ----tty-stream-chunk-separator - Uncaught exception in bad-test-chain.js - - bad-test-chain.js:3 - - 2: -  3: test.serial.test('passes', t => t.pass()); - 4: - - TypeError: test.serial.test is not a function - - › Object. (test-tap/fixture/report/regular/bad-test-chain.js:3:13) - ----tty-stream-chunk-separator - ✖ bad-test-chain.js exited with a non-zero exit code: 1 ----tty-stream-chunk-separator - ✖ nested-objects › format with max depth 4 ----tty-stream-chunk-separator - ✖ nested-objects › format like with max depth 4 ----tty-stream-chunk-separator - output-in-hook › before hook - ℹ before ----tty-stream-chunk-separator - output-in-hook › beforeEach hook for passing test - ℹ beforeEach ----tty-stream-chunk-separator - output-in-hook › beforeEach hook for failing test - ℹ beforeEach ----tty-stream-chunk-separator - ✔ output-in-hook › passing test ----tty-stream-chunk-separator - ✖ output-in-hook › failing test Test failed via `t.fail()` ----tty-stream-chunk-separator - output-in-hook › afterEach hook for passing test - ℹ afterEach ----tty-stream-chunk-separator - output-in-hook › afterEach.always hook for failing test - ℹ afterEachAlways ----tty-stream-chunk-separator - output-in-hook › afterEach.always hook for passing test - ℹ afterEachAlways ----tty-stream-chunk-separator - output-in-hook › cleanup - ℹ afterAlways ----tty-stream-chunk-separator - - test › skip ----tty-stream-chunk-separator - - test › todo ----tty-stream-chunk-separator - ✔ test › passes ----tty-stream-chunk-separator - ✖ test › fails Test failed via `t.fail()` ----tty-stream-chunk-separator - ✔ test › known failure ----tty-stream-chunk-separator - ✖ test › no longer failing Test was expected to fail, but succeeded, you should stop marking the test as failing ----tty-stream-chunk-separator - ✖ test › logs Test failed via `t.fail()` - ℹ hello - ℹ world ----tty-stream-chunk-separator - ✖ test › formatted ----tty-stream-chunk-separator - ✖ test › power-assert ----tty-stream-chunk-separator - ✖ test › bad throws Improper usage of `t.throws()` detected ----tty-stream-chunk-separator - ✖ test › bad notThrows Improper usage of `t.notThrows()` detected ----tty-stream-chunk-separator - ✖ test › implementation throws non-error Error thrown in test ----tty-stream-chunk-separator - ✖ traces-in-t-throws › throws ----tty-stream-chunk-separator - ✖ traces-in-t-throws › notThrows ----tty-stream-chunk-separator - ✖ traces-in-t-throws › notThrowsAsync ----tty-stream-chunk-separator - ✖ traces-in-t-throws › throwsAsync ----tty-stream-chunk-separator - ✖ traces-in-t-throws › throwsAsync different error ----tty-stream-chunk-separator - ✔ uncaught-exception › passes ----tty-stream-chunk-separator - - Uncaught exception in uncaught-exception.js - - uncaught-exception.js:5 - - 4: setImmediate(() => { -  5: throw new Error('Can’t catch me'); - 6: }); - - Error: Can’t catch me - - › Immediate.setImmediate (test-tap/fixture/report/regular/uncaught-exception.js:5:9) - ----tty-stream-chunk-separator - ✖ uncaught-exception.js exited with a non-zero exit code: 1 ----tty-stream-chunk-separator - ✔ unhandled-rejection › passes ----tty-stream-chunk-separator - ✔ unhandled-rejection › unhandled non-error rejection ----tty-stream-chunk-separator - - Unhandled rejection in unhandled-rejection.js - - unhandled-rejection.js:4 - - 3: const passes = t => { -  4: Promise.reject(new Error('Can’t catch me')); - 5: t.pass(); - - Error: Can’t catch me - - › passes (test-tap/fixture/report/regular/unhandled-rejection.js:4:17) - ----tty-stream-chunk-separator - Unhandled rejection in unhandled-rejection.js - - null - ----tty-stream-chunk-separator - ─ - - nested-objects › format with max depth 4 - - nested-objects.js:28 - - 27: }; -  28: t.deepEqual(exp, act); - 29: }); - - Difference: - - { - a: { - b: { - foo: 'bar', - }, - }, - + c: { - + d: { - + e: { - + foo: 'bar', - + }, - + }, - + }, - } - - › t (test-tap/fixture/report/regular/nested-objects.js:28:4) - - - - nested-objects › format like with max depth 4 - - nested-objects.js:54 - - 53: }; -  54: t.like(actual, pattern); - 55: }); - - Difference: - - { - a: { - b: { - - foo: 'bar', - + foo: 'qux', - }, - }, - } - - › t (test-tap/fixture/report/regular/nested-objects.js:54:4) - - - - output-in-hook › failing test - - output-in-hook.js:34 - - 33: test('failing test', t => { -  34: t.fail();  - 35: }); - - Test failed via `t.fail()` - - › t (test-tap/fixture/report/regular/output-in-hook.js:34:4) - - - - test › fails - - test.js:9 - - 8: -  9: test('fails', t => t.fail()); - 10: - - Test failed via `t.fail()` - - › t (test-tap/fixture/report/regular/test.js:9:22) - - - - test › no longer failing - - Error: Test was expected to fail, but succeeded, you should stop marking the test as failing - - - - test › logs - - ℹ hello - ℹ world - - test.js:18 - - 17: t.log('world'); -  18: t.fail();  - 19: }); - - Test failed via `t.fail()` - - › t (test-tap/fixture/report/regular/test.js:18:4) - - - - test › formatted - - test.js:22 - - 21: test('formatted', t => { -  22: t.deepEqual('foo', 'bar'); - 23: }); - - Difference: - - - 'foo' - + 'bar' - - › t (test-tap/fixture/report/regular/test.js:22:4) - - - - test › power-assert - - test.js:27 - - 26: const foo = ''; -  27: t.assert(foo);  - 28: }); - - Value is not truthy: - - '' - - foo - => '' - - › t (test-tap/fixture/report/regular/test.js:27:4) - - - - test › bad throws - - test.js:35 - - 34: -  35: t.throws(fn()); - 36: }); - - Improper usage of `t.throws()` detected - - The following error was thrown, possibly before `t.throws()` could be called: - - Error { - message: 'err', - } - - Try wrapping the first argument to `t.throws()` in a function: - - t.throws(() => { /* your code here */ }) - - Visit the following URL for more details: - - https://github.com/avajs/ava/blob/v1.0.0-beta.5.1/docs/03-assertions.md#throwsfn-expected-message - - › fn (test-tap/fixture/report/regular/test.js:32:9) - › t (test-tap/fixture/report/regular/test.js:35:11) - - - - test › bad notThrows - - test.js:43 - - 42: -  43: t.notThrows(fn()); - 44: }); - - Improper usage of `t.notThrows()` detected - - The following error was thrown, possibly before `t.notThrows()` could be called: - - Error { - message: 'err', - } - - Try wrapping the first argument to `t.notThrows()` in a function: - - t.notThrows(() => { /* your code here */ }) - - Visit the following URL for more details: - - https://github.com/avajs/ava/blob/v1.0.0-beta.5.1/docs/03-assertions.md#throwsfn-expected-message - - › fn (test-tap/fixture/report/regular/test.js:40:9) - › t (test-tap/fixture/report/regular/test.js:43:14) - - - - test › implementation throws non-error - - Error thrown in test: - - null - - - - traces-in-t-throws › throws - - traces-in-t-throws.js:12 - - 11: test('throws', t => { -  12: t.throws(() => throwError(), {instanceOf: TypeError}); - 13: }); - - Function threw unexpected exception: - - Error { - message: 'uh-oh', - } - - Expected instance of: - - Function TypeError {} - - › throwError (test-tap/fixture/report/regular/traces-in-t-throws.js:4:8) - › t.throws._avaThrowsHelperEnd (test-tap/fixture/report/regular/traces-in-t-throws.js:12:17) - › t (test-tap/fixture/report/regular/traces-in-t-throws.js:12:4) - - - - traces-in-t-throws › notThrows - - traces-in-t-throws.js:16 - - 15: test('notThrows', t => { -  16: t.notThrows(() => throwError()); - 17: }); - - Function threw: - - Error { - message: 'uh-oh', - } - - › throwError (test-tap/fixture/report/regular/traces-in-t-throws.js:4:8) - › t.notThrows._avaThrowsHelperEnd (test-tap/fixture/report/regular/traces-in-t-throws.js:16:20) - › t (test-tap/fixture/report/regular/traces-in-t-throws.js:16:4) - - - - traces-in-t-throws › notThrowsAsync - - traces-in-t-throws.js:20 - - 19: test('notThrowsAsync', t => { -  20: t.notThrowsAsync(() => throwError()); - 21: }); - - Function threw: - - Error { - message: 'uh-oh', - } - - › throwError (test-tap/fixture/report/regular/traces-in-t-throws.js:4:8) - › t.notThrowsAsync (test-tap/fixture/report/regular/traces-in-t-throws.js:20:25) - › t (test-tap/fixture/report/regular/traces-in-t-throws.js:20:4) - - - - traces-in-t-throws › throwsAsync - - traces-in-t-throws.js:24 - - 23: test('throwsAsync', t => { -  24: t.throwsAsync(() => throwError(), {instanceOf: TypeError}); - 25: }); - - Function threw synchronously. Use `t.throws()` instead: - - Error { - message: 'uh-oh', - } - - › throwError (test-tap/fixture/report/regular/traces-in-t-throws.js:4:8) - › t.throwsAsync (test-tap/fixture/report/regular/traces-in-t-throws.js:24:22) - › t (test-tap/fixture/report/regular/traces-in-t-throws.js:24:4) - - - - traces-in-t-throws › throwsAsync different error - - traces-in-t-throws.js:28 - - 27: test('throwsAsync different error', t => { -  28: return t.throwsAsync(returnRejectedPromise, {instanceOf: TypeError}); - 29: }); - - Returned promise rejected with unexpected exception: - - Error { - message: 'uh-oh', - } - - Expected instance of: - - Function TypeError {} - - › returnRejectedPromise (test-tap/fixture/report/regular/traces-in-t-throws.js:8:24) - › t (test-tap/fixture/report/regular/traces-in-t-throws.js:28:11) - - ─ - - 16 tests failed - 1 known failure - 1 test skipped - 1 test todo - 2 unhandled rejections - 2 uncaught exceptions ----tty-stream-chunk-separator diff --git a/test-tap/reporters/verbose.timeoutinmultiplefiles.v10.log b/test-tap/reporters/verbose.timeoutinmultiplefiles.v10.log deleted file mode 100644 index 50f1f1e5a..000000000 --- a/test-tap/reporters/verbose.timeoutinmultiplefiles.v10.log +++ /dev/null @@ -1,33 +0,0 @@ - ----tty-stream-chunk-separator - ✔ a › a passes ----tty-stream-chunk-separator - ✔ a › a passes two ----tty-stream-chunk-separator -  - ✖ Timed out while running tests - - 2 tests were pending in a.js - - ◌ a › a slow - ◌ a › a slow two - ----tty-stream-chunk-separator - ✔ b › b passes ----tty-stream-chunk-separator - ✔ b › b passes two ----tty-stream-chunk-separator -  - ✖ Timed out while running tests - - 3 tests were pending in b.js - - ◌ b › b slow - ◌ b › b slow two - ◌ b › b slow three - ----tty-stream-chunk-separator - ─ - - 4 tests passed ----tty-stream-chunk-separator diff --git a/test-tap/reporters/verbose.timeoutinsinglefile.v10.log b/test-tap/reporters/verbose.timeoutinsinglefile.v10.log deleted file mode 100644 index edc7e415d..000000000 --- a/test-tap/reporters/verbose.timeoutinsinglefile.v10.log +++ /dev/null @@ -1,19 +0,0 @@ - ----tty-stream-chunk-separator - ✔ passes ----tty-stream-chunk-separator - ✔ passes two ----tty-stream-chunk-separator -  - ✖ Timed out while running tests - - 2 tests were pending in a.js - - ◌ slow - ◌ slow two - ----tty-stream-chunk-separator - ─ - - 2 tests passed ----tty-stream-chunk-separator diff --git a/test-tap/reporters/verbose.timeoutwithmatch.v10.log b/test-tap/reporters/verbose.timeoutwithmatch.v10.log deleted file mode 100644 index b40ca5cf8..000000000 --- a/test-tap/reporters/verbose.timeoutwithmatch.v10.log +++ /dev/null @@ -1,17 +0,0 @@ - ----tty-stream-chunk-separator - ✔ passes needle ----tty-stream-chunk-separator -  - ✖ Timed out while running tests - - 2 tests were pending in a.js - - ◌ slow needle - ◌ slow three needle - ----tty-stream-chunk-separator - ─ - - 1 test passed ----tty-stream-chunk-separator diff --git a/test-tap/reporters/verbose.watch.v10.log b/test-tap/reporters/verbose.watch.v10.log deleted file mode 100644 index ae2dea44b..000000000 --- a/test-tap/reporters/verbose.watch.v10.log +++ /dev/null @@ -1,32 +0,0 @@ - ----tty-stream-chunk-separator - ✔ test › passes ----tty-stream-chunk-separator - ─ - - 1 test passed [17:19:12] - ----tty-stream-chunk-separator -──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ----tty-stream-chunk-separator - ----tty-stream-chunk-separator - ✔ test › passes ----tty-stream-chunk-separator - ─ - - 1 test passed [17:19:12] - 2 previous failures in test files that were not rerun - ----tty-stream-chunk-separator -──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ----tty-stream-chunk-separator - ----tty-stream-chunk-separator - ✔ test › passes ----tty-stream-chunk-separator - ─ - - 1 test passed [17:19:12] - ----tty-stream-chunk-separator diff --git a/test/config/integration.js b/test/config/integration.js index 4190f0195..e1cd046ce 100644 --- a/test/config/integration.js +++ b/test/config/integration.js @@ -40,17 +40,15 @@ test('resolves tests from the package.json dir if none are specified on cli', as t.snapshot(result.stats.passed, 'resolves test files from configuration'); }); -if (process.versions.node >= '12.17.0') { - test('resolves tests from an .mjs config file', async t => { - const options = { - cwd: exec.cwd('mjs-with-tests/dir-a-wrapper') - }; +test('resolves tests from an .mjs config file', async t => { + const options = { + cwd: exec.cwd('mjs-with-tests/dir-a-wrapper') + }; - const result = await exec.fixture(['--verbose'], options); + const result = await exec.fixture(['--verbose'], options); - t.snapshot(result.stats.passed, 'resolves test files from configuration'); - }); -} + t.snapshot(result.stats.passed, 'resolves test files from configuration'); +}); test('use current working directory if `package.json` is not found', async t => { const cwd = tempy.directory(); diff --git a/test/helpers/exec.js b/test/helpers/exec.js index 52922715a..b02aaca6f 100644 --- a/test/helpers/exec.js +++ b/test/helpers/exec.js @@ -1,5 +1,4 @@ const path = require('path'); -const v8 = require('v8'); const test = require('@ava/test'); const execa = require('execa'); @@ -9,8 +8,6 @@ const replaceString = require('replace-string'); const cliPath = path.resolve(__dirname, '../../cli.js'); const ttySimulator = path.join(__dirname, './simulate-tty.js'); -const serialization = process.versions.node >= '12.16.0' ? 'advanced' : 'json'; - const normalizePosixPath = string => replaceString(string, '\\', '/'); const normalizePath = (root, file) => normalizePosixPath(path.posix.normalize(path.relative(root, file))); @@ -50,7 +47,7 @@ exports.fixture = async (args, options = {}) => { AVA_EMIT_RUN_STATUS_OVER_IPC: 'I\'ll find a payphone baby / Take some time to talk to you' }, cwd, - serialization, + serialization: 'advanced', nodeOptions: ['--require', ttySimulator] }, options)); @@ -81,10 +78,6 @@ exports.fixture = async (args, options = {}) => { }; running.on('message', statusEvent => { - if (serialization === 'json') { - statusEvent = v8.deserialize(Uint8Array.from(statusEvent)); - } - switch (statusEvent.type) { case 'hook-failed': { const {title, testFile} = statusEvent; diff --git a/test/shared-workers/requires-newish-node/fixtures/_worker.js b/test/shared-workers/requires-newish-node/fixtures/_worker.js deleted file mode 100644 index 6a922a379..000000000 --- a/test/shared-workers/requires-newish-node/fixtures/_worker.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = async ({negotiateProtocol}) => { - negotiateProtocol(['experimental']).ready(); -}; diff --git a/test/shared-workers/requires-newish-node/fixtures/package.json b/test/shared-workers/requires-newish-node/fixtures/package.json deleted file mode 100644 index e677ba947..000000000 --- a/test/shared-workers/requires-newish-node/fixtures/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "ava": { - "nonSemVerExperiments": { - "sharedWorkers": true - } - } -} diff --git a/test/shared-workers/requires-newish-node/fixtures/test.js b/test/shared-workers/requires-newish-node/fixtures/test.js deleted file mode 100644 index a4859f3ee..000000000 --- a/test/shared-workers/requires-newish-node/fixtures/test.js +++ /dev/null @@ -1,10 +0,0 @@ -const test = require('ava'); -const plugin = require('ava/plugin'); -const {available} = plugin.registerSharedWorker({ - supportedProtocols: ['experimental'], - filename: require.resolve('./_worker') -}); - -test('worker becomes available', async t => { - await t.notThrowsAsync(available); -}); diff --git a/test/shared-workers/requires-newish-node/test.js b/test/shared-workers/requires-newish-node/test.js deleted file mode 100644 index 2663dbb77..000000000 --- a/test/shared-workers/requires-newish-node/test.js +++ /dev/null @@ -1,17 +0,0 @@ -const test = require('@ava/test'); -const exec = require('../../helpers/exec'); - -test('requires node.js >= 12.17', async t => { - const result = await exec.fixture().catch(error => error); - - t.log(result.stdout); - - if (process.versions.node >= '12.17.0') { - t.is(result.exitCode, 0); - } else { - t.is(result.exitCode, 1); - t.is(result.stats.uncaughtExceptions.length, 1); - // Don't snapshot since it can't easily be updated anyway. - t.is(result.stats.uncaughtExceptions[0].message, 'Shared workers require Node.js 12.17 or newer'); - } -});