Update dependencies & other general maintenance
* Upgrade XO * Update TypeScript-related dependencies — Don't upgrade @sindresorhus/tsconfig to v6 since it requires TS 5.5 and we test with 5.2. * Update dev dependencies * Update dependencies * Rebuild lockfile * Upgrade CodeCov action * Update reporter log instructions and remove deprecation warnings * Make Node.js 22.6 the recommended development version * Remove Node.js 21 from the engines list: It's no longer maintained by Node.js itself, see also <https://github.com/avajs/ava/blob/main/docs/support-statement.md>.
This commit is contained in:
parent
f8bf00cd98
commit
b15df53939
54 changed files with 2505 additions and 3643 deletions
7
.github/workflows/ci.yml
vendored
7
.github/workflows/ci.yml
vendored
|
|
@ -15,7 +15,7 @@ jobs:
|
|||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
node-version: [^18.18, ^20.8, ^21, ^22]
|
||||
node-version: [^18.18, ^20.8, ^22]
|
||||
os: [ubuntu-latest, windows-latest, macos-latest]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
|
@ -31,17 +31,18 @@ jobs:
|
|||
- run: npm install --no-audit
|
||||
- run: ./scripts/ci.sh
|
||||
shell: bash
|
||||
- uses: codecov/codecov-action@v3
|
||||
- uses: codecov/codecov-action@v4
|
||||
with:
|
||||
files: coverage/lcov.info
|
||||
name: ${{ matrix.os }}/${{ matrix.node-version }}
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
|
||||
typescript:
|
||||
name: TypeScript compatibility
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
ts-version: [~5.2, ~5.3]
|
||||
ts-version: [~5.2, ~5.3, ~5.4, ~5.5]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ module.exports = {
|
|||
files: '**/*.d.*(c|m)ts',
|
||||
rules: {
|
||||
'import/extensions': 'off',
|
||||
'n/file-extension-in-import': 'off',
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
@ -91,6 +92,7 @@ module.exports = {
|
|||
rules: {
|
||||
'import/no-anonymous-default-export': 'off',
|
||||
'n/prefer-global/process': 'off',
|
||||
'promise/prefer-await-to-then': 'off',
|
||||
'unicorn/error-message': 'off',
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ AVA supports the latest release of any major version that [is supported by Node.
|
|||
|
||||
When we drop support for an LTS-covered major version we will bump AVA's major version number.
|
||||
|
||||
We will drop support for odd-numbered Node.js versions (e.g. `11` or `13`) *without* bumping AVA's major version number.
|
||||
We will drop support for odd-numbered Node.js versions (e.g. `21` or `23`) *without* bumping AVA's major version number.
|
||||
|
||||
We try to avoid *accidentally* dropping support for non-latest Node.js releases. If such breakage does occur we'll accept pull requests to restore functionality. We might decide to deprecate the offending AVA release and bump AVA's major version number instead.
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
'use strict';
|
||||
|
||||
module.exports = (request, response) => {
|
||||
const app = (request, response) => {
|
||||
if (request.url === '/user') {
|
||||
response.setHeader('Content-Type', 'application/json');
|
||||
response.end(JSON.stringify({email: 'ava@rocks.com'}));
|
||||
|
|
@ -9,3 +9,5 @@ module.exports = (request, response) => {
|
|||
response.end();
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = app;
|
||||
|
|
|
|||
|
|
@ -423,7 +423,7 @@ export class Assertions {
|
|||
retval = fn();
|
||||
if (isPromise(retval)) {
|
||||
// Here isPromise() checks if something is "promise like". Cast to an actual promise.
|
||||
Promise.resolve(retval).catch(noop);
|
||||
Promise.resolve(retval).catch(noop); // eslint-disable-line promise/prefer-await-to-then
|
||||
throw fail(new AssertionError(message, {
|
||||
assertion: 't.throws()',
|
||||
formattedDetails: [formatWithLabel('Function returned a promise. Use `t.throwsAsync()` instead:', retval)],
|
||||
|
|
@ -462,7 +462,10 @@ export class Assertions {
|
|||
try {
|
||||
assertMessage(message, 't.throwsAsync()');
|
||||
} catch (error) {
|
||||
Promise.resolve(thrower).catch(noop);
|
||||
try {
|
||||
await thrower;
|
||||
} catch {}
|
||||
|
||||
throw error;
|
||||
}
|
||||
|
||||
|
|
@ -476,7 +479,10 @@ export class Assertions {
|
|||
try {
|
||||
expectations = validateExpectations('t.throwsAsync()', expectations, args.length, experiments);
|
||||
} catch (error) {
|
||||
Promise.resolve(thrower).catch(noop);
|
||||
try {
|
||||
await thrower;
|
||||
} catch {}
|
||||
|
||||
throw fail(error);
|
||||
}
|
||||
|
||||
|
|
@ -484,7 +490,7 @@ export class Assertions {
|
|||
// Record the stack before it gets lost in the promise chain.
|
||||
const assertionStack = getAssertionStack();
|
||||
// Handle "promise like" objects by casting to a real Promise.
|
||||
const intermediate = Promise.resolve(promise).then(value => {
|
||||
const intermediate = Promise.resolve(promise).then(value => { // eslint-disable-line promise/prefer-await-to-then
|
||||
throw failPending(new AssertionError(message, {
|
||||
assertion: 't.throwsAsync()',
|
||||
assertionStack,
|
||||
|
|
@ -568,7 +574,10 @@ export class Assertions {
|
|||
try {
|
||||
assertMessage(message, 't.notThrowsAsync()');
|
||||
} catch (error) {
|
||||
Promise.resolve(nonThrower).catch(noop);
|
||||
try {
|
||||
await nonThrower;
|
||||
} catch {}
|
||||
|
||||
throw error;
|
||||
}
|
||||
|
||||
|
|
@ -583,7 +592,7 @@ export class Assertions {
|
|||
// Create an error object to record the stack before it gets lost in the promise chain.
|
||||
const assertionStack = getAssertionStack();
|
||||
// Handle "promise like" objects by casting to a real Promise.
|
||||
const intermediate = Promise.resolve(promise).then(noop, error => {
|
||||
const intermediate = Promise.resolve(promise).then(noop, error => { // eslint-disable-line promise/prefer-await-to-then
|
||||
throw failPending(new AssertionError(message, {
|
||||
assertion: 't.notThrowsAsync()',
|
||||
assertionStack,
|
||||
|
|
|
|||
|
|
@ -41,10 +41,9 @@ const buildGlobs = ({conf, providers, projectDir, overrideExtensions, overrideFi
|
|||
|
||||
const resolveGlobs = async (projectDir, overrideExtensions, overrideFiles) => {
|
||||
if (!configCache.has(projectDir)) {
|
||||
configCache.set(projectDir, loadConfig({resolveFrom: projectDir}).then(async ({config: conf}) => {
|
||||
const providers = await collectProviders({conf, projectDir});
|
||||
return {conf, providers};
|
||||
}));
|
||||
const {config: conf} = await loadConfig({resolveFrom: projectDir});
|
||||
const providers = await collectProviders({conf, projectDir});
|
||||
configCache.set(projectDir, {conf, providers});
|
||||
}
|
||||
|
||||
const {conf, providers} = await configCache.get(projectDir);
|
||||
|
|
|
|||
|
|
@ -16,6 +16,11 @@ const waitForAvailable = async worker => {
|
|||
}
|
||||
};
|
||||
|
||||
const waitForError = async worker => {
|
||||
const [error] = await events.once(worker, 'error');
|
||||
return tagWorkerError(error);
|
||||
};
|
||||
|
||||
function launchWorker(filename, initialData) {
|
||||
if (launchedWorkers.has(filename)) {
|
||||
return launchedWorkers.get(filename);
|
||||
|
|
@ -34,7 +39,7 @@ function launchWorker(filename, initialData) {
|
|||
const launched = {
|
||||
statePromises: {
|
||||
available: waitForAvailable(worker),
|
||||
error: events.once(worker, 'error').then(([error]) => tagWorkerError(error)),
|
||||
error: waitForError(worker),
|
||||
},
|
||||
exited: false,
|
||||
worker,
|
||||
|
|
@ -79,7 +84,7 @@ export async function observeWorkerProcess(fork, runStatus) {
|
|||
}
|
||||
};
|
||||
|
||||
fork.promise.finally(() => {
|
||||
fork.promise.finally(() => { // eslint-disable-line promise/prefer-await-to-then
|
||||
removeAllInstances();
|
||||
});
|
||||
|
||||
|
|
@ -94,7 +99,7 @@ export async function observeWorkerProcess(fork, runStatus) {
|
|||
}
|
||||
};
|
||||
|
||||
launched.statePromises.error.then(error => {
|
||||
launched.statePromises.error.then(error => { // eslint-disable-line promise/prefer-await-to-then
|
||||
launched.worker.off('message', handleWorkerMessage);
|
||||
removeAllInstances();
|
||||
runStatus.emitStateChange({type: 'shared-worker-error', err: serializeError(error)});
|
||||
|
|
@ -113,7 +118,7 @@ export async function observeWorkerProcess(fork, runStatus) {
|
|||
port,
|
||||
}, [port]);
|
||||
|
||||
fork.promise.finally(() => {
|
||||
fork.promise.finally(() => { // eslint-disable-line promise/prefer-await-to-then
|
||||
launched.worker.postMessage({
|
||||
type: 'deregister-test-worker',
|
||||
id: fork.threadId,
|
||||
|
|
|
|||
|
|
@ -489,7 +489,7 @@ export default class Runner extends Emittery {
|
|||
|
||||
// Note that the hooks and tests always begin running asynchronously.
|
||||
const beforePromise = this.runHooks(this.tasks.before, contextRef);
|
||||
const serialPromise = beforePromise.then(beforeHooksOk => {
|
||||
const serialPromise = beforePromise.then(beforeHooksOk => { // eslint-disable-line promise/prefer-await-to-then
|
||||
// Don't run tests if a `before` hook failed.
|
||||
if (!beforeHooksOk) {
|
||||
return false;
|
||||
|
|
@ -511,7 +511,7 @@ export default class Runner extends Emittery {
|
|||
return this.runTest(task, contextRef.copy());
|
||||
}, true);
|
||||
});
|
||||
const concurrentPromise = Promise.all([beforePromise, serialPromise]).then(async ([beforeHooksOk, serialOk]) => {
|
||||
const concurrentPromise = Promise.all([beforePromise, serialPromise]).then(async ([beforeHooksOk, serialOk]) => { // eslint-disable-line promise/prefer-await-to-then
|
||||
// Don't run tests if a `before` hook failed, or if `failFast` is enabled
|
||||
// and a previous serial test failed.
|
||||
if (!beforeHooksOk || (!serialOk && this.failFast)) {
|
||||
|
|
|
|||
|
|
@ -590,7 +590,7 @@ export default class Test {
|
|||
};
|
||||
|
||||
promise
|
||||
.catch(error => {
|
||||
.catch(error => { // eslint-disable-line promise/prefer-await-to-then
|
||||
if (this.testFailure !== null && error === this.testFailure) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -607,7 +607,7 @@ export default class Test {
|
|||
}));
|
||||
}
|
||||
})
|
||||
.then(() => resolve(this.finish()));
|
||||
.then(() => resolve(this.finish())); // eslint-disable-line promise/prefer-await-to-then
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ async function * plan({api, filter, globs, projectDir, providers, stdin, abortSi
|
|||
};
|
||||
|
||||
// Begin a file trace in the background.
|
||||
fileTracer.update(findTests(cwdAndGlobs).then(testFiles => testFiles.map(path => ({
|
||||
fileTracer.update(findTests(cwdAndGlobs).then(testFiles => testFiles.map(path => ({ // eslint-disable-line promise/prefer-await-to-then
|
||||
path: nodePath.relative(projectDir, path),
|
||||
isTest: true,
|
||||
exists: true,
|
||||
|
|
@ -187,7 +187,7 @@ async function * plan({api, filter, globs, projectDir, providers, stdin, abortSi
|
|||
// If the file tracer is still analyzing dependencies, wait for that to
|
||||
// complete.
|
||||
if (fileTracer.busy !== null) {
|
||||
fileTracer.busy.then(() => debounce.refresh());
|
||||
fileTracer.busy.then(() => debounce.refresh()); // eslint-disable-line promise/prefer-await-to-then
|
||||
takeCoverageForSelfTests?.();
|
||||
return;
|
||||
}
|
||||
|
|
@ -526,7 +526,7 @@ class FileTracer {
|
|||
}
|
||||
|
||||
update(changes) {
|
||||
const current = this.#update(changes).finally(() => {
|
||||
const current = this.#update(changes).finally(() => { // eslint-disable-line promise/prefer-await-to-then
|
||||
if (this.#pendingTrace === current) {
|
||||
this.#pendingTrace = null;
|
||||
this.#updateRunning = new Promise(resolve => {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import {mkdir} from 'node:fs/promises';
|
||||
import {createRequire} from 'node:module';
|
||||
import {join as joinPath, resolve as resolvePath} from 'node:path';
|
||||
import path from 'node:path';
|
||||
import process from 'node:process';
|
||||
import {pathToFileURL} from 'node:url';
|
||||
import {workerData} from 'node:worker_threads';
|
||||
|
|
@ -89,7 +89,7 @@ const run = async options => {
|
|||
|
||||
refs.runnerChain = runner.chain;
|
||||
|
||||
channel.peerFailed.then(() => {
|
||||
channel.peerFailed.then(() => { // eslint-disable-line promise/prefer-await-to-then
|
||||
runner.interrupt();
|
||||
});
|
||||
|
||||
|
|
@ -187,7 +187,7 @@ const run = async options => {
|
|||
|
||||
// Try to load the module as a file, relative to the project directory.
|
||||
// Match load() behavior.
|
||||
const fullPath = resolvePath(projectDir, ref);
|
||||
const fullPath = path.resolve(projectDir, ref);
|
||||
try {
|
||||
for (const extension of extensionsToLoadAsModules) {
|
||||
if (fullPath.endsWith(`.${extension}`)) {
|
||||
|
|
@ -208,9 +208,9 @@ const run = async options => {
|
|||
|
||||
let importFromProject = async ref => {
|
||||
// Do not use the cacheDir since it's not guaranteed to be inside node_modules.
|
||||
const avaCacheDir = joinPath(projectDir, 'node_modules', '.cache', 'ava');
|
||||
const avaCacheDir = path.join(projectDir, 'node_modules', '.cache', 'ava');
|
||||
await mkdir(avaCacheDir, {recursive: true});
|
||||
const stubPath = joinPath(avaCacheDir, 'import-from-project.mjs');
|
||||
const stubPath = path.join(avaCacheDir, 'import-from-project.mjs');
|
||||
await writeFileAtomic(stubPath, 'export const importFromProject = ref => import(ref);\n');
|
||||
({importFromProject} = await import(pathToFileURL(stubPath)));
|
||||
return importFromProject(ref);
|
||||
|
|
|
|||
|
|
@ -158,9 +158,9 @@ function registerSharedWorker(filename, initialData) {
|
|||
// The attaching of message listeners will cause the port to be referenced by
|
||||
// Node.js. In order to keep track, explicitly reference before attaching.
|
||||
sharedWorkerHandle.ref();
|
||||
const ready = selectAvaMessage(ourPort, 'ready').then(() => {
|
||||
const ready = selectAvaMessage(ourPort, 'ready').then(() => { // eslint-disable-line promise/prefer-await-to-then
|
||||
currentlyAvailable = error === null;
|
||||
}).finally(() => {
|
||||
}).finally(() => { // eslint-disable-line promise/prefer-await-to-then
|
||||
// Once ready, it's up to user code to subscribe to messages, which (see
|
||||
// below) causes us to reference the port.
|
||||
sharedWorkerHandle.unref();
|
||||
|
|
@ -170,7 +170,7 @@ function registerSharedWorker(filename, initialData) {
|
|||
|
||||
// Errors are received over the test worker channel, not the message port
|
||||
// dedicated to the shared worker.
|
||||
events.once(channelEmitter, 'shared-worker-error').then(() => {
|
||||
events.once(channelEmitter, 'shared-worker-error').then(() => { // eslint-disable-line promise/prefer-await-to-then
|
||||
unsubscribe();
|
||||
sharedWorkerHandle.forceUnref();
|
||||
error = new Error('The shared worker is no longer available');
|
||||
|
|
|
|||
4827
package-lock.json
generated
4827
package-lock.json
generated
File diff suppressed because it is too large
Load diff
50
package.json
50
package.json
|
|
@ -36,7 +36,7 @@
|
|||
},
|
||||
"type": "module",
|
||||
"engines": {
|
||||
"node": "^18.18 || ^20.8 || ^21 || ^22"
|
||||
"node": "^18.18 || ^20.8 || ^22"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "./scripts/test.sh"
|
||||
|
|
@ -83,14 +83,14 @@
|
|||
"typescript"
|
||||
],
|
||||
"dependencies": {
|
||||
"@vercel/nft": "^0.26.2",
|
||||
"acorn": "^8.11.3",
|
||||
"acorn-walk": "^8.3.2",
|
||||
"@vercel/nft": "^0.27.3",
|
||||
"acorn": "^8.12.1",
|
||||
"acorn-walk": "^8.3.3",
|
||||
"ansi-styles": "^6.2.1",
|
||||
"arrgv": "^1.0.2",
|
||||
"arrify": "^3.0.0",
|
||||
"callsites": "^4.1.0",
|
||||
"cbor": "^9.0.1",
|
||||
"callsites": "^4.2.0",
|
||||
"cbor": "^9.0.2",
|
||||
"chalk": "^5.3.0",
|
||||
"chunkd": "^2.0.1",
|
||||
"ci-info": "^4.0.0",
|
||||
|
|
@ -100,10 +100,10 @@
|
|||
"common-path-prefix": "^3.0.0",
|
||||
"concordance": "^5.0.4",
|
||||
"currently-unhandled": "^0.4.1",
|
||||
"debug": "^4.3.4",
|
||||
"emittery": "^1.0.1",
|
||||
"figures": "^6.0.1",
|
||||
"globby": "^14.0.0",
|
||||
"debug": "^4.3.6",
|
||||
"emittery": "^1.0.3",
|
||||
"figures": "^6.1.0",
|
||||
"globby": "^14.0.2",
|
||||
"ignore-by-default": "^2.1.0",
|
||||
"indent-string": "^5.0.0",
|
||||
"is-plain-object": "^5.0.0",
|
||||
|
|
@ -111,11 +111,11 @@
|
|||
"matcher": "^5.0.0",
|
||||
"memoize": "^10.0.0",
|
||||
"ms": "^2.1.3",
|
||||
"p-map": "^7.0.1",
|
||||
"p-map": "^7.0.2",
|
||||
"package-config": "^5.0.0",
|
||||
"picomatch": "^3.0.1",
|
||||
"picomatch": "^4.0.2",
|
||||
"plur": "^5.1.0",
|
||||
"pretty-ms": "^9.0.0",
|
||||
"pretty-ms": "^9.1.0",
|
||||
"resolve-cwd": "^3.0.0",
|
||||
"stack-utils": "^2.0.6",
|
||||
"strip-ansi": "^7.1.0",
|
||||
|
|
@ -126,19 +126,19 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"@ava/test": "github:avajs/test",
|
||||
"@ava/typescript": "^4.1.0",
|
||||
"@sindresorhus/tsconfig": "^5.0.0",
|
||||
"@types/node": "^20.11.10",
|
||||
"ansi-escapes": "^6.2.0",
|
||||
"c8": "^9.1.0",
|
||||
"execa": "^8.0.1",
|
||||
"@ava/typescript": "^5.0.0",
|
||||
"@sindresorhus/tsconfig": "^5.1.1",
|
||||
"@types/node": "^20.16.1",
|
||||
"ansi-escapes": "^7.0.0",
|
||||
"c8": "^10.1.2",
|
||||
"execa": "^9.3.1",
|
||||
"expect": "^29.7.0",
|
||||
"sinon": "^17.0.1",
|
||||
"tap": "^18.7.0",
|
||||
"sinon": "^18.0.0",
|
||||
"tap": "^20.0.3",
|
||||
"tempy": "^3.1.0",
|
||||
"tsd": "^0.30.4",
|
||||
"typescript": "~5.3.3",
|
||||
"xo": "^0.57.0",
|
||||
"tsd": "^0.31.1",
|
||||
"typescript": "~5.5.4",
|
||||
"xo": "^0.59.3",
|
||||
"zen-observable": "^0.10.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
|
|
@ -150,6 +150,6 @@
|
|||
}
|
||||
},
|
||||
"volta": {
|
||||
"node": "20.10.0"
|
||||
"node": "22.6.0"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#!/bin/bash
|
||||
set -ex
|
||||
|
||||
# Set environment variable to have the AVA config skip wathch mode tests.
|
||||
# Set environment variable to have the AVA config skip watch mode tests.
|
||||
TEST_AVA_SKIP_WATCH_MODE=1 npx c8 --report=none npx test-ava
|
||||
|
||||
# Reduce concurrency to give watch mode tests a better chance of succeeding in
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
module.exports = ({projectDir}) => ({
|
||||
const configFactory = ({projectDir}) => ({
|
||||
files: projectDir,
|
||||
});
|
||||
|
||||
module.exports = configFactory;
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
class Config {}
|
||||
|
||||
export default () => new Config();
|
||||
const configFactory = () => new Config();
|
||||
|
||||
export default configFactory;
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
export default ({projectDir}) => ({
|
||||
const configFactory = ({projectDir}) => ({
|
||||
files: projectDir,
|
||||
});
|
||||
|
||||
export default configFactory;
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
const util = require('node:util');
|
||||
const {inspect} = require('node:util');
|
||||
|
||||
const test = require('../../../../entrypoints/main.cjs');
|
||||
|
||||
util.inspect.defaultOptions.depth = 4;
|
||||
inspect.defaultOptions.depth = 4;
|
||||
|
||||
test('format with max depth 4', t => {
|
||||
const exp = {
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ const fixColors = () => {
|
|||
Object.defineProperty(process, 'platform', {value: 'darwin', enumerable: true, configurable: true});
|
||||
};
|
||||
|
||||
export default () => {
|
||||
const fixReporterEnv = () => {
|
||||
// Fix timestamps.
|
||||
const clock = sinon.useFakeTimers({
|
||||
now: new Date(2014, 11, 19, 17, 19, 12, 200).getTime(),
|
||||
|
|
@ -32,4 +32,5 @@ export default () => {
|
|||
};
|
||||
};
|
||||
|
||||
export default fixReporterEnv;
|
||||
export {fixColors as onlyColors};
|
||||
|
|
|
|||
|
|
@ -1,59 +0,0 @@
|
|||
|
||||
---tty-stream-chunk-separator
|
||||
[35m⚠ Could not parse ast-syntax-error.cjs for line number selection[39m
|
||||
|
||||
SyntaxError: Unexpected token (3:11)
|
||||
|
||||
---tty-stream-chunk-separator
|
||||
[1mUncaught exception in ast-syntax-error.cjs[22m
|
||||
|
||||
~/test-tap/fixture/report/edgecases/ast-syntax-error.cjs:3
|
||||
const fn = do {
|
||||
^^
|
||||
|
||||
SyntaxError: Unexpected token 'do'
|
||||
|
||||
---tty-stream-chunk-separator
|
||||
[31m✘ ast-syntax-error.cjs exited with a non-zero exit code: 1[39m
|
||||
---tty-stream-chunk-separator
|
||||
[31m✘ No tests found in ava-import-no-test-declaration.cjs[39m
|
||||
---tty-stream-chunk-separator
|
||||
|
||||
[1mUncaught exception in import-and-use-test-member.cjs[22m
|
||||
|
||||
[90mimport-and-use-test-member.cjs:3[39m
|
||||
|
||||
[90m2:[39m
|
||||
[41m[1m 3: test('pass', t => t.pass());[22m[49m
|
||||
[90m4:[39m
|
||||
|
||||
TypeError: test is not a function
|
||||
|
||||
[90m› Object.<anonymous> (test-tap/fixture/report/edgecases/import-and-use-test-member.cjs:3:1)[39m
|
||||
|
||||
---tty-stream-chunk-separator
|
||||
[31m✘ import-and-use-test-member.cjs exited with a non-zero exit code: 1[39m
|
||||
---tty-stream-chunk-separator
|
||||
[31m✘ No tests found in no-ava-import.cjs, make sure to import "ava" at the top of your test file[39m
|
||||
---tty-stream-chunk-separator
|
||||
[31m✘ Line numbers for test.cjs did not match any tests[39m
|
||||
---tty-stream-chunk-separator
|
||||
|
||||
[1mUncaught exception in throws.cjs[22m
|
||||
|
||||
[90mthrows.cjs:1[39m
|
||||
|
||||
[41m[1m 1: throw new Error('throws');[22m[49m
|
||||
[90m2:[39m
|
||||
|
||||
Error: throws
|
||||
|
||||
[90m› Object.<anonymous> (test-tap/fixture/report/edgecases/throws.cjs:1:7)[39m
|
||||
|
||||
---tty-stream-chunk-separator
|
||||
[31m✘ throws.cjs exited with a non-zero exit code: 1[39m
|
||||
---tty-stream-chunk-separator
|
||||
[90m─[39m
|
||||
|
||||
[31m3 uncaught exceptions[39m
|
||||
---tty-stream-chunk-separator
|
||||
|
|
@ -1,7 +1,4 @@
|
|||
|
||||
---tty-stream-chunk-separator
|
||||
(node:14147) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
|
||||
(Use `node --trace-deprecation ...` to show where the warning was created)
|
||||
---tty-stream-chunk-separator
|
||||
[35m⚠ Could not parse ast-syntax-error.cjs for line number selection[39m
|
||||
|
||||
|
|
@ -18,14 +15,8 @@
|
|||
|
||||
---tty-stream-chunk-separator
|
||||
[31m✘ ast-syntax-error.cjs exited with a non-zero exit code: 1[39m
|
||||
---tty-stream-chunk-separator
|
||||
(node:14149) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
|
||||
(Use `node --trace-deprecation ...` to show where the warning was created)
|
||||
---tty-stream-chunk-separator
|
||||
[31m✘ No tests found in ava-import-no-test-declaration.cjs[39m
|
||||
---tty-stream-chunk-separator
|
||||
(node:14151) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
|
||||
(Use `node --trace-deprecation ...` to show where the warning was created)
|
||||
---tty-stream-chunk-separator
|
||||
|
||||
[1mUncaught exception in import-and-use-test-member.cjs[22m
|
||||
|
|
@ -42,19 +33,10 @@
|
|||
|
||||
---tty-stream-chunk-separator
|
||||
[31m✘ import-and-use-test-member.cjs exited with a non-zero exit code: 1[39m
|
||||
---tty-stream-chunk-separator
|
||||
(node:14153) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
|
||||
(Use `node --trace-deprecation ...` to show where the warning was created)
|
||||
---tty-stream-chunk-separator
|
||||
[31m✘ No tests found in no-ava-import.cjs, make sure to import "ava" at the top of your test file[39m
|
||||
---tty-stream-chunk-separator
|
||||
(node:14154) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
|
||||
(Use `node --trace-deprecation ...` to show where the warning was created)
|
||||
---tty-stream-chunk-separator
|
||||
[31m✘ Line numbers for test.cjs did not match any tests[39m
|
||||
---tty-stream-chunk-separator
|
||||
(node:14155) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
|
||||
(Use `node --trace-deprecation ...` to show where the warning was created)
|
||||
---tty-stream-chunk-separator
|
||||
|
||||
[1mUncaught exception in throws.cjs[22m
|
||||
|
|
|
|||
|
|
@ -1,24 +0,0 @@
|
|||
|
||||
---tty-stream-chunk-separator
|
||||
[31m✘ [fail]:[39m a [90m[2m›[22m[39m fails [3m[31mTest failed via `t.fail()`[39m[23m
|
||||
---tty-stream-chunk-separator
|
||||
[90m─[39m
|
||||
|
||||
[1ma [90m[2m›[22m[1m[39m fails[22m
|
||||
|
||||
[90ma.cjs:3[39m
|
||||
|
||||
[90m2:[39m
|
||||
[41m[1m 3: test('fails', t => t.fail());[22m[49m
|
||||
[90m4:[39m
|
||||
|
||||
Test failed via `t.fail()`
|
||||
|
||||
[90m› test-tap/fixture/report/failfast/a.cjs:3:22[39m
|
||||
|
||||
[90m─[39m
|
||||
|
||||
[35m`--fail-fast` is on. 1 test file was skipped.[39m
|
||||
|
||||
[31m1 test failed[39m
|
||||
---tty-stream-chunk-separator
|
||||
|
|
@ -1,7 +1,4 @@
|
|||
|
||||
---tty-stream-chunk-separator
|
||||
(node:14129) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
|
||||
(Use `node --trace-deprecation ...` to show where the warning was created)
|
||||
---tty-stream-chunk-separator
|
||||
[31m✘ [fail]:[39m a [90m[2m›[22m[39m fails [3m[31mTest failed via `t.fail()`[39m[23m
|
||||
---tty-stream-chunk-separator
|
||||
|
|
|
|||
|
|
@ -1,24 +0,0 @@
|
|||
|
||||
---tty-stream-chunk-separator
|
||||
[31m✘ [fail]:[39m a [90m[2m›[22m[39m fails [3m[31mTest failed via `t.fail()`[39m[23m
|
||||
---tty-stream-chunk-separator
|
||||
[90m─[39m
|
||||
|
||||
[1ma [90m[2m›[22m[1m[39m fails[22m
|
||||
|
||||
[90ma.cjs:3[39m
|
||||
|
||||
[90m2:[39m
|
||||
[41m[1m 3: test('fails', t => t.fail()); [22m[49m
|
||||
[90m4:[39m test('passes', t => t.pass());
|
||||
|
||||
Test failed via `t.fail()`
|
||||
|
||||
[90m› test-tap/fixture/report/failfast2/a.cjs:3:22[39m
|
||||
|
||||
[90m─[39m
|
||||
|
||||
[35m`--fail-fast` is on. At least 1 test was skipped, as well as 1 test file.[39m
|
||||
|
||||
[31m1 test failed[39m
|
||||
---tty-stream-chunk-separator
|
||||
|
|
@ -1,7 +1,4 @@
|
|||
|
||||
---tty-stream-chunk-separator
|
||||
(node:14130) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
|
||||
(Use `node --trace-deprecation ...` to show where the warning was created)
|
||||
---tty-stream-chunk-separator
|
||||
[31m✘ [fail]:[39m a [90m[2m›[22m[39m fails [3m[31mTest failed via `t.fail()`[39m[23m
|
||||
---tty-stream-chunk-separator
|
||||
|
|
|
|||
|
|
@ -1,10 +0,0 @@
|
|||
|
||||
---tty-stream-chunk-separator
|
||||
[32m✔[39m a [90m[2m›[22m[39m only
|
||||
---tty-stream-chunk-separator
|
||||
[32m✔[39m b [90m[2m›[22m[39m passes
|
||||
---tty-stream-chunk-separator
|
||||
[90m─[39m
|
||||
|
||||
[32m2 tests passed[39m
|
||||
---tty-stream-chunk-separator
|
||||
|
|
@ -1,12 +1,6 @@
|
|||
|
||||
---tty-stream-chunk-separator
|
||||
(node:14133) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
|
||||
(Use `node --trace-deprecation ...` to show where the warning was created)
|
||||
---tty-stream-chunk-separator
|
||||
[32m✔[39m a [90m[2m›[22m[39m only
|
||||
---tty-stream-chunk-separator
|
||||
(node:14136) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
|
||||
(Use `node --trace-deprecation ...` to show where the warning was created)
|
||||
---tty-stream-chunk-separator
|
||||
[32m✔[39m b [90m[2m›[22m[39m passes
|
||||
---tty-stream-chunk-separator
|
||||
|
|
|
|||
|
|
@ -1,359 +0,0 @@
|
|||
|
||||
---tty-stream-chunk-separator
|
||||
[1mUncaught exception in bad-test-chain.cjs[22m
|
||||
|
||||
[90mbad-test-chain.cjs:3[39m
|
||||
|
||||
[90m2:[39m
|
||||
[41m[1m 3: test.serial.test('passes', t => t.pass());[22m[49m
|
||||
[90m4:[39m
|
||||
|
||||
TypeError: test.serial.test is not a function
|
||||
|
||||
[90m› Object.<anonymous> (test-tap/fixture/report/regular/bad-test-chain.cjs:3:13)[39m
|
||||
|
||||
---tty-stream-chunk-separator
|
||||
[31m✘ bad-test-chain.cjs exited with a non-zero exit code: 1[39m
|
||||
---tty-stream-chunk-separator
|
||||
[31m✘ [fail]:[39m nested-objects [90m[2m›[22m[39m format with max depth 4
|
||||
---tty-stream-chunk-separator
|
||||
[31m✘ [fail]:[39m nested-objects [90m[2m›[22m[39m format like with max depth 4
|
||||
---tty-stream-chunk-separator
|
||||
output-in-hook [90m[2m›[22m[39m before hook
|
||||
[35mℹ[39m [90mbefore[39m
|
||||
---tty-stream-chunk-separator
|
||||
output-in-hook [90m[2m›[22m[39m beforeEach hook for passing test
|
||||
[35mℹ[39m [90mbeforeEach[39m
|
||||
---tty-stream-chunk-separator
|
||||
output-in-hook [90m[2m›[22m[39m beforeEach hook for failing test
|
||||
[35mℹ[39m [90mbeforeEach[39m
|
||||
---tty-stream-chunk-separator
|
||||
[32m✔[39m output-in-hook [90m[2m›[22m[39m passing test
|
||||
---tty-stream-chunk-separator
|
||||
[31m✘ [fail]:[39m output-in-hook [90m[2m›[22m[39m failing test [3m[31mTest failed via `t.fail()`[39m[23m
|
||||
---tty-stream-chunk-separator
|
||||
output-in-hook [90m[2m›[22m[39m afterEach hook for passing test
|
||||
[35mℹ[39m [90mafterEach[39m
|
||||
---tty-stream-chunk-separator
|
||||
output-in-hook [90m[2m›[22m[39m afterEach.always hook for failing test
|
||||
[35mℹ[39m [90mafterEachAlways[39m
|
||||
---tty-stream-chunk-separator
|
||||
output-in-hook [90m[2m›[22m[39m afterEach.always hook for passing test
|
||||
[35mℹ[39m [90mafterEachAlways[39m
|
||||
---tty-stream-chunk-separator
|
||||
output-in-hook [90m[2m›[22m[39m cleanup
|
||||
[35mℹ[39m [90mafterAlways[39m
|
||||
---tty-stream-chunk-separator
|
||||
[33m- [skip] test [90m[2m›[22m[39m[33m skip[39m
|
||||
---tty-stream-chunk-separator
|
||||
[34m- [todo] test [90m[2m›[22m[39m[34m todo[39m
|
||||
---tty-stream-chunk-separator
|
||||
[32m✔[39m test [90m[2m›[22m[39m passes
|
||||
---tty-stream-chunk-separator
|
||||
[31m✘ [fail]:[39m test [90m[2m›[22m[39m fails [3m[31mTest failed via `t.fail()`[39m[23m
|
||||
---tty-stream-chunk-separator
|
||||
[31m✔ [expected fail][39m test [90m[2m›[22m[39m known failure
|
||||
---tty-stream-chunk-separator
|
||||
[31m✘ [unexpected pass]:[39m test [90m[2m›[22m[39m no longer failing [3m[31mTest was expected to fail, but succeeded, you should stop marking the test as failing[39m[23m
|
||||
---tty-stream-chunk-separator
|
||||
[31m✘ [fail]:[39m test [90m[2m›[22m[39m logs [3m[31mTest failed via `t.fail()`[39m[23m
|
||||
[35mℹ[39m [90mhello[39m
|
||||
[35mℹ[39m [90mworld[39m
|
||||
---tty-stream-chunk-separator
|
||||
[31m✘ [fail]:[39m test [90m[2m›[22m[39m formatted
|
||||
---tty-stream-chunk-separator
|
||||
[31m✘ [fail]:[39m test [90m[2m›[22m[39m implementation throws non-error [3m[31mError thrown in test[39m[23m
|
||||
---tty-stream-chunk-separator
|
||||
[31m✘ [fail]:[39m traces-in-t-throws [90m[2m›[22m[39m throws
|
||||
---tty-stream-chunk-separator
|
||||
[31m✘ [fail]:[39m traces-in-t-throws [90m[2m›[22m[39m notThrows
|
||||
---tty-stream-chunk-separator
|
||||
[31m✘ [fail]:[39m traces-in-t-throws [90m[2m›[22m[39m notThrowsAsync
|
||||
---tty-stream-chunk-separator
|
||||
[31m✘ [fail]:[39m traces-in-t-throws [90m[2m›[22m[39m throwsAsync
|
||||
---tty-stream-chunk-separator
|
||||
[31m✘ [fail]:[39m traces-in-t-throws [90m[2m›[22m[39m throwsAsync different error
|
||||
---tty-stream-chunk-separator
|
||||
[32m✔[39m uncaught-exception [90m[2m›[22m[39m passes
|
||||
---tty-stream-chunk-separator
|
||||
|
||||
[1mUncaught exception in uncaught-exception.cjs[22m
|
||||
|
||||
[90muncaught-exception.cjs:5[39m
|
||||
|
||||
[90m4:[39m setImmediate(() => {
|
||||
[41m[1m 5: throw new Error('Can’t catch me');[22m[49m
|
||||
[90m6:[39m });
|
||||
|
||||
Error: Can’t catch me
|
||||
|
||||
[90m› Immediate.<anonymous> (test-tap/fixture/report/regular/uncaught-exception.cjs:5:9)[39m
|
||||
|
||||
---tty-stream-chunk-separator
|
||||
[31m✘ uncaught-exception.cjs exited with a non-zero exit code: 1[39m
|
||||
---tty-stream-chunk-separator
|
||||
[32m✔[39m unhandled-rejection [90m[2m›[22m[39m passes
|
||||
---tty-stream-chunk-separator
|
||||
[32m✔[39m unhandled-rejection [90m[2m›[22m[39m unhandled non-error rejection
|
||||
---tty-stream-chunk-separator
|
||||
|
||||
[1mUnhandled rejection in unhandled-rejection.cjs[22m
|
||||
|
||||
[90munhandled-rejection.cjs:4[39m
|
||||
|
||||
[90m3:[39m const passes = t => {
|
||||
[41m[1m 4: Promise.reject(new Error('Can’t catch me'));[22m[49m
|
||||
[90m5:[39m t.pass();
|
||||
|
||||
Error: Can’t catch me
|
||||
|
||||
[90m› passes (test-tap/fixture/report/regular/unhandled-rejection.cjs:4:17)[39m
|
||||
|
||||
---tty-stream-chunk-separator
|
||||
[1mUnhandled rejection in unhandled-rejection.cjs[22m
|
||||
|
||||
[33mnull[39m
|
||||
|
||||
---tty-stream-chunk-separator
|
||||
[31m✘ unhandled-rejection.cjs exited with a non-zero exit code: 1[39m
|
||||
---tty-stream-chunk-separator
|
||||
[90m─[39m
|
||||
|
||||
[1mnested-objects [90m[2m›[22m[1m[39m format with max depth 4[22m
|
||||
|
||||
[90mnested-objects.cjs:29[39m
|
||||
|
||||
[90m28:[39m };
|
||||
[41m[1m 29: t.deepEqual(exp, act);[22m[49m
|
||||
[90m30:[39m });
|
||||
|
||||
Difference ([31m-[39m [31mactual[39m, [32m+[39m [32mexpected[39m):
|
||||
|
||||
[90m{[39m
|
||||
a: [90m{[39m
|
||||
b: [90m{[39m
|
||||
foo: [34m'[39m[34mbar[39m[34m'[39m[90m,[39m
|
||||
[90m}[39m[90m,[39m
|
||||
[90m}[39m[90m,[39m
|
||||
[32m+[39m c: [90m{[39m
|
||||
[32m+[39m d: [90m{[39m
|
||||
[32m+[39m e: [90m{[39m
|
||||
[32m+[39m foo: [34m'[39m[34mbar[39m[34m'[39m[90m,[39m
|
||||
[32m+[39m [90m}[39m[90m,[39m
|
||||
[32m+[39m [90m}[39m[90m,[39m
|
||||
[32m+[39m [90m}[39m[90m,[39m
|
||||
[90m}[39m
|
||||
|
||||
[90m› test-tap/fixture/report/regular/nested-objects.cjs:29:4[39m
|
||||
|
||||
|
||||
|
||||
[1mnested-objects [90m[2m›[22m[1m[39m format like with max depth 4[22m
|
||||
|
||||
[90mnested-objects.cjs:55[39m
|
||||
|
||||
[90m54:[39m };
|
||||
[41m[1m 55: t.like(actual, pattern);[22m[49m
|
||||
[90m56:[39m });
|
||||
|
||||
Difference ([31m-[39m [31mactual[39m, [32m+[39m [32mexpected[39m):
|
||||
|
||||
[90m{[39m
|
||||
a: [90m{[39m
|
||||
b: [90m{[39m
|
||||
[31m-[39m foo: [34m'[39m[31mbar[39m[34m'[39m[90m,[39m
|
||||
[32m+[39m foo: [34m'[39m[32mqux[39m[34m'[39m[90m,[39m
|
||||
[90m}[39m[90m,[39m
|
||||
[90m}[39m[90m,[39m
|
||||
[90m}[39m
|
||||
|
||||
[90m› test-tap/fixture/report/regular/nested-objects.cjs:55:4[39m
|
||||
|
||||
|
||||
|
||||
[1moutput-in-hook [90m[2m›[22m[1m[39m failing test[22m
|
||||
|
||||
[90moutput-in-hook.cjs:34[39m
|
||||
|
||||
[90m33:[39m test('failing test', t => {
|
||||
[41m[1m 34: t.fail(); [22m[49m
|
||||
[90m35:[39m });
|
||||
|
||||
Test failed via `t.fail()`
|
||||
|
||||
[90m› test-tap/fixture/report/regular/output-in-hook.cjs:34:4[39m
|
||||
|
||||
|
||||
|
||||
[1mtest [90m[2m›[22m[1m[39m fails[22m
|
||||
|
||||
[90mtest.cjs:9[39m
|
||||
|
||||
[90m8:[39m
|
||||
[41m[1m 9: test('fails', t => t.fail());[22m[49m
|
||||
[90m10:[39m
|
||||
|
||||
Test failed via `t.fail()`
|
||||
|
||||
[90m› test-tap/fixture/report/regular/test.cjs:9:22[39m
|
||||
|
||||
|
||||
|
||||
[1mtest [90m[2m›[22m[1m[39m no longer failing[22m
|
||||
|
||||
Test was expected to fail, but succeeded, you should stop marking the test as failing
|
||||
|
||||
|
||||
|
||||
[1mtest [90m[2m›[22m[1m[39m logs[22m
|
||||
[90mtest.cjs:18[39m
|
||||
|
||||
[90m17:[39m t.log('world');
|
||||
[41m[1m 18: t.fail(); [22m[49m
|
||||
[90m19:[39m });
|
||||
|
||||
Test failed via `t.fail()`
|
||||
|
||||
[90m› test-tap/fixture/report/regular/test.cjs:18:4[39m
|
||||
|
||||
|
||||
|
||||
[1mtest [90m[2m›[22m[1m[39m formatted[22m
|
||||
|
||||
[90mtest.cjs:22[39m
|
||||
|
||||
[90m21:[39m test('formatted', t => {
|
||||
[41m[1m 22: t.deepEqual('foo', 'bar');[22m[49m
|
||||
[90m23:[39m });
|
||||
|
||||
Difference ([31m-[39m [31mactual[39m, [32m+[39m [32mexpected[39m):
|
||||
|
||||
[31m-[39m [34m'[39m[31mfoo[39m[34m'[39m
|
||||
[32m+[39m [34m'[39m[32mbar[39m[34m'[39m
|
||||
|
||||
[90m› test-tap/fixture/report/regular/test.cjs:22:4[39m
|
||||
|
||||
|
||||
|
||||
[1mtest [90m[2m›[22m[1m[39m implementation throws non-error[22m
|
||||
|
||||
Error thrown in test:
|
||||
|
||||
[33mnull[39m
|
||||
|
||||
|
||||
|
||||
[1mtraces-in-t-throws [90m[2m›[22m[1m[39m throws[22m
|
||||
|
||||
[90mtraces-in-t-throws.cjs:12[39m
|
||||
|
||||
[90m11:[39m test('throws', t => {
|
||||
[41m[1m 12: t.throws(() => throwError(), {instanceOf: TypeError});[22m[49m
|
||||
[90m13:[39m });
|
||||
|
||||
Function threw unexpected exception:
|
||||
|
||||
[35mError[39m [90m{[39m
|
||||
message: [34m'[39m[34muh-oh[39m[34m'[39m[90m,[39m
|
||||
[90m}[39m
|
||||
|
||||
Expected instance of:
|
||||
|
||||
[35mFunction[39m [34mTypeError[39m [90m{[39m[90m}[39m
|
||||
|
||||
[90m› throwError (test-tap/fixture/report/regular/traces-in-t-throws.cjs:4:8)[39m
|
||||
[90m› t.throws.instanceOf (test-tap/fixture/report/regular/traces-in-t-throws.cjs:12:17)[39m
|
||||
[90m› test-tap/fixture/report/regular/traces-in-t-throws.cjs:12:4[39m
|
||||
|
||||
|
||||
|
||||
[1mtraces-in-t-throws [90m[2m›[22m[1m[39m notThrows[22m
|
||||
|
||||
[90mtraces-in-t-throws.cjs:16[39m
|
||||
|
||||
[90m15:[39m test('notThrows', t => {
|
||||
[41m[1m 16: t.notThrows(() => throwError());[22m[49m
|
||||
[90m17:[39m });
|
||||
|
||||
Function threw:
|
||||
|
||||
[35mError[39m [90m{[39m
|
||||
message: [34m'[39m[34muh-oh[39m[34m'[39m[90m,[39m
|
||||
[90m}[39m
|
||||
|
||||
[90m› throwError (test-tap/fixture/report/regular/traces-in-t-throws.cjs:4:8)[39m
|
||||
[90m› test-tap/fixture/report/regular/traces-in-t-throws.cjs:16:20[39m
|
||||
[90m› test-tap/fixture/report/regular/traces-in-t-throws.cjs:16:4[39m
|
||||
|
||||
|
||||
|
||||
[1mtraces-in-t-throws [90m[2m›[22m[1m[39m notThrowsAsync[22m
|
||||
|
||||
[90mtraces-in-t-throws.cjs:20[39m
|
||||
|
||||
[90m19:[39m test('notThrowsAsync', async t => {
|
||||
[41m[1m 20: await t.notThrowsAsync(() => throwError());[22m[49m
|
||||
[90m21:[39m });
|
||||
|
||||
Function threw:
|
||||
|
||||
[35mError[39m [90m{[39m
|
||||
message: [34m'[39m[34muh-oh[39m[34m'[39m[90m,[39m
|
||||
[90m}[39m
|
||||
|
||||
[90m› throwError (test-tap/fixture/report/regular/traces-in-t-throws.cjs:4:8)[39m
|
||||
[90m› test-tap/fixture/report/regular/traces-in-t-throws.cjs:20:31[39m
|
||||
[90m› test-tap/fixture/report/regular/traces-in-t-throws.cjs:20:10[39m
|
||||
|
||||
|
||||
|
||||
[1mtraces-in-t-throws [90m[2m›[22m[1m[39m throwsAsync[22m
|
||||
|
||||
[90mtraces-in-t-throws.cjs:24[39m
|
||||
|
||||
[90m23:[39m test('throwsAsync', async t => {
|
||||
[41m[1m 24: await t.throwsAsync(() => throwError(), {instanceOf: TypeError});[22m[49m
|
||||
[90m25:[39m });
|
||||
|
||||
Function threw synchronously. Use `t.throws()` instead:
|
||||
|
||||
[35mError[39m [90m{[39m
|
||||
message: [34m'[39m[34muh-oh[39m[34m'[39m[90m,[39m
|
||||
[90m}[39m
|
||||
|
||||
[90m› throwError (test-tap/fixture/report/regular/traces-in-t-throws.cjs:4:8)[39m
|
||||
[90m› t.throwsAsync.instanceOf (test-tap/fixture/report/regular/traces-in-t-throws.cjs:24:28)[39m
|
||||
[90m› test-tap/fixture/report/regular/traces-in-t-throws.cjs:24:10[39m
|
||||
|
||||
|
||||
|
||||
[1mtraces-in-t-throws [90m[2m›[22m[1m[39m throwsAsync different error[22m
|
||||
|
||||
[90mtraces-in-t-throws.cjs:28[39m
|
||||
|
||||
[90m27:[39m test('throwsAsync different error', async t => {
|
||||
[41m[1m 28: await t.throwsAsync(returnRejectedPromise, {instanceOf: TypeError});[22m[49m
|
||||
[90m29:[39m });
|
||||
|
||||
Returned promise rejected with unexpected exception:
|
||||
|
||||
[35mError[39m [90m{[39m
|
||||
message: [34m'[39m[34muh-oh[39m[34m'[39m[90m,[39m
|
||||
[90m}[39m
|
||||
|
||||
Expected instance of:
|
||||
|
||||
[35mFunction[39m [34mTypeError[39m [90m{[39m[90m}[39m
|
||||
|
||||
[90m› returnRejectedPromise (test-tap/fixture/report/regular/traces-in-t-throws.cjs:8:24)[39m
|
||||
[90m› test-tap/fixture/report/regular/traces-in-t-throws.cjs:28:10[39m
|
||||
|
||||
[90m─[39m
|
||||
|
||||
[31m13 tests failed[39m
|
||||
[31m1 known failure[39m
|
||||
[33m1 test skipped[39m
|
||||
[34m1 test todo[39m
|
||||
[31m2 unhandled rejections[39m
|
||||
[31m2 uncaught exceptions[39m
|
||||
---tty-stream-chunk-separator
|
||||
|
|
@ -1,7 +1,4 @@
|
|||
|
||||
---tty-stream-chunk-separator
|
||||
(node:14114) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
|
||||
(Use `node --trace-deprecation ...` to show where the warning was created)
|
||||
---tty-stream-chunk-separator
|
||||
[1mUncaught exception in bad-test-chain.cjs[22m
|
||||
|
||||
|
|
@ -17,16 +14,10 @@
|
|||
|
||||
---tty-stream-chunk-separator
|
||||
[31m✘ bad-test-chain.cjs exited with a non-zero exit code: 1[39m
|
||||
---tty-stream-chunk-separator
|
||||
(node:14115) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
|
||||
(Use `node --trace-deprecation ...` to show where the warning was created)
|
||||
---tty-stream-chunk-separator
|
||||
[31m✘ [fail]:[39m nested-objects [90m[2m›[22m[39m format with max depth 4
|
||||
---tty-stream-chunk-separator
|
||||
[31m✘ [fail]:[39m nested-objects [90m[2m›[22m[39m format like with max depth 4
|
||||
---tty-stream-chunk-separator
|
||||
(node:14119) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
|
||||
(Use `node --trace-deprecation ...` to show where the warning was created)
|
||||
---tty-stream-chunk-separator
|
||||
output-in-hook [90m[2m›[22m[39m before hook
|
||||
[35mℹ[39m [90mbefore[39m
|
||||
|
|
@ -52,9 +43,6 @@
|
|||
---tty-stream-chunk-separator
|
||||
output-in-hook [90m[2m›[22m[39m cleanup
|
||||
[35mℹ[39m [90mafterAlways[39m
|
||||
---tty-stream-chunk-separator
|
||||
(node:14121) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
|
||||
(Use `node --trace-deprecation ...` to show where the warning was created)
|
||||
---tty-stream-chunk-separator
|
||||
[33m- [skip] test [90m[2m›[22m[39m[33m skip[39m
|
||||
---tty-stream-chunk-separator
|
||||
|
|
@ -75,9 +63,6 @@
|
|||
[31m✘ [fail]:[39m test [90m[2m›[22m[39m formatted
|
||||
---tty-stream-chunk-separator
|
||||
[31m✘ [fail]:[39m test [90m[2m›[22m[39m implementation throws non-error [3m[31mError thrown in test[39m[23m
|
||||
---tty-stream-chunk-separator
|
||||
(node:14122) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
|
||||
(Use `node --trace-deprecation ...` to show where the warning was created)
|
||||
---tty-stream-chunk-separator
|
||||
[31m✘ [fail]:[39m traces-in-t-throws [90m[2m›[22m[39m throws
|
||||
---tty-stream-chunk-separator
|
||||
|
|
@ -88,9 +73,6 @@
|
|||
[31m✘ [fail]:[39m traces-in-t-throws [90m[2m›[22m[39m throwsAsync
|
||||
---tty-stream-chunk-separator
|
||||
[31m✘ [fail]:[39m traces-in-t-throws [90m[2m›[22m[39m throwsAsync different error
|
||||
---tty-stream-chunk-separator
|
||||
(node:14124) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
|
||||
(Use `node --trace-deprecation ...` to show where the warning was created)
|
||||
---tty-stream-chunk-separator
|
||||
[32m✔[39m uncaught-exception [90m[2m›[22m[39m passes
|
||||
---tty-stream-chunk-separator
|
||||
|
|
@ -109,9 +91,6 @@
|
|||
|
||||
---tty-stream-chunk-separator
|
||||
[31m✘ uncaught-exception.cjs exited with a non-zero exit code: 1[39m
|
||||
---tty-stream-chunk-separator
|
||||
(node:14126) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
|
||||
(Use `node --trace-deprecation ...` to show where the warning was created)
|
||||
---tty-stream-chunk-separator
|
||||
[32m✔[39m unhandled-rejection [90m[2m›[22m[39m passes
|
||||
---tty-stream-chunk-separator
|
||||
|
|
|
|||
|
|
@ -1,38 +0,0 @@
|
|||
|
||||
---tty-stream-chunk-separator
|
||||
[32m✔[39m a [90m[2m›[22m[39m a passes
|
||||
---tty-stream-chunk-separator
|
||||
[32m✔[39m a [90m[2m›[22m[39m a passes two
|
||||
---tty-stream-chunk-separator
|
||||
[31m[39m
|
||||
[31m✘ Timed out while running tests[39m
|
||||
|
||||
2 tests were pending in a.cjs
|
||||
|
||||
◌ a [90m[2m›[22m[39m a slow
|
||||
[35mℹ[39m [90mthis slow test prints useful debug message just text[39m
|
||||
◌ a [90m[2m›[22m[39m a slow two
|
||||
[35mℹ[39m [90manother useful debug message [90m{[39m[90m[39m
|
||||
[90m x: [33m5[39m[90m[90m,[39m[90m[39m
|
||||
[90m[90m}[39m[90m[39m
|
||||
|
||||
---tty-stream-chunk-separator
|
||||
[32m✔[39m b [90m[2m›[22m[39m a passes
|
||||
---tty-stream-chunk-separator
|
||||
[32m✔[39m b [90m[2m›[22m[39m a passes two
|
||||
---tty-stream-chunk-separator
|
||||
[31m[39m
|
||||
[31m✘ Timed out while running tests[39m
|
||||
|
||||
2 tests were pending in b.cjs
|
||||
|
||||
◌ b [90m[2m›[22m[39m a slow
|
||||
[35mℹ[39m [90mhello world[39m
|
||||
◌ b [90m[2m›[22m[39m a slow two
|
||||
|
||||
---tty-stream-chunk-separator
|
||||
[90m─[39m
|
||||
|
||||
[32m4 tests passed[39m
|
||||
[31m4 tests remained pending after a timeout[39m
|
||||
---tty-stream-chunk-separator
|
||||
|
|
@ -1,7 +1,4 @@
|
|||
|
||||
---tty-stream-chunk-separator
|
||||
(node:14164) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
|
||||
(Use `node --trace-deprecation ...` to show where the warning was created)
|
||||
---tty-stream-chunk-separator
|
||||
[32m✔[39m a [90m[2m›[22m[39m a passes
|
||||
---tty-stream-chunk-separator
|
||||
|
|
@ -19,9 +16,6 @@
|
|||
[90m x: [33m5[39m[90m[90m,[39m[90m[39m
|
||||
[90m[90m}[39m[90m[39m
|
||||
|
||||
---tty-stream-chunk-separator
|
||||
(node:14165) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
|
||||
(Use `node --trace-deprecation ...` to show where the warning was created)
|
||||
---tty-stream-chunk-separator
|
||||
[32m✔[39m b [90m[2m›[22m[39m a passes
|
||||
---tty-stream-chunk-separator
|
||||
|
|
|
|||
|
|
@ -1,34 +0,0 @@
|
|||
|
||||
---tty-stream-chunk-separator
|
||||
[32m✔[39m a [90m[2m›[22m[39m a passes
|
||||
---tty-stream-chunk-separator
|
||||
[32m✔[39m a [90m[2m›[22m[39m a passes two
|
||||
---tty-stream-chunk-separator
|
||||
[31m[39m
|
||||
[31m✘ Timed out while running tests[39m
|
||||
|
||||
2 tests were pending in a.cjs
|
||||
|
||||
◌ a [90m[2m›[22m[39m a slow
|
||||
◌ a [90m[2m›[22m[39m a slow two
|
||||
|
||||
---tty-stream-chunk-separator
|
||||
[32m✔[39m b [90m[2m›[22m[39m b passes
|
||||
---tty-stream-chunk-separator
|
||||
[32m✔[39m b [90m[2m›[22m[39m b passes two
|
||||
---tty-stream-chunk-separator
|
||||
[31m[39m
|
||||
[31m✘ Timed out while running tests[39m
|
||||
|
||||
3 tests were pending in b.cjs
|
||||
|
||||
◌ b [90m[2m›[22m[39m b slow
|
||||
◌ b [90m[2m›[22m[39m b slow two
|
||||
◌ b [90m[2m›[22m[39m b slow three
|
||||
|
||||
---tty-stream-chunk-separator
|
||||
[90m─[39m
|
||||
|
||||
[32m4 tests passed[39m
|
||||
[31m5 tests remained pending after a timeout[39m
|
||||
---tty-stream-chunk-separator
|
||||
|
|
@ -1,7 +1,4 @@
|
|||
|
||||
---tty-stream-chunk-separator
|
||||
(node:14159) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
|
||||
(Use `node --trace-deprecation ...` to show where the warning was created)
|
||||
---tty-stream-chunk-separator
|
||||
[32m✔[39m a [90m[2m›[22m[39m a passes
|
||||
---tty-stream-chunk-separator
|
||||
|
|
@ -15,9 +12,6 @@
|
|||
◌ a [90m[2m›[22m[39m a slow
|
||||
◌ a [90m[2m›[22m[39m a slow two
|
||||
|
||||
---tty-stream-chunk-separator
|
||||
(node:14160) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
|
||||
(Use `node --trace-deprecation ...` to show where the warning was created)
|
||||
---tty-stream-chunk-separator
|
||||
[32m✔[39m b [90m[2m›[22m[39m b passes
|
||||
---tty-stream-chunk-separator
|
||||
|
|
|
|||
|
|
@ -1,20 +0,0 @@
|
|||
|
||||
---tty-stream-chunk-separator
|
||||
[32m✔[39m passes
|
||||
---tty-stream-chunk-separator
|
||||
[32m✔[39m passes two
|
||||
---tty-stream-chunk-separator
|
||||
[31m[39m
|
||||
[31m✘ Timed out while running tests[39m
|
||||
|
||||
2 tests were pending in a.cjs
|
||||
|
||||
◌ slow
|
||||
◌ slow two
|
||||
|
||||
---tty-stream-chunk-separator
|
||||
[90m─[39m
|
||||
|
||||
[32m2 tests passed[39m
|
||||
[31m2 tests remained pending after a timeout[39m
|
||||
---tty-stream-chunk-separator
|
||||
|
|
@ -1,7 +1,4 @@
|
|||
|
||||
---tty-stream-chunk-separator
|
||||
(node:14156) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
|
||||
(Use `node --trace-deprecation ...` to show where the warning was created)
|
||||
---tty-stream-chunk-separator
|
||||
[32m✔[39m passes
|
||||
---tty-stream-chunk-separator
|
||||
|
|
|
|||
|
|
@ -1,18 +0,0 @@
|
|||
|
||||
---tty-stream-chunk-separator
|
||||
[32m✔[39m passes needle
|
||||
---tty-stream-chunk-separator
|
||||
[31m[39m
|
||||
[31m✘ Timed out while running tests[39m
|
||||
|
||||
2 tests were pending in a.cjs
|
||||
|
||||
◌ slow needle
|
||||
◌ slow three needle
|
||||
|
||||
---tty-stream-chunk-separator
|
||||
[90m─[39m
|
||||
|
||||
[32m1 test passed[39m
|
||||
[31m2 tests remained pending after a timeout[39m
|
||||
---tty-stream-chunk-separator
|
||||
|
|
@ -1,7 +1,4 @@
|
|||
|
||||
---tty-stream-chunk-separator
|
||||
(node:14162) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
|
||||
(Use `node --trace-deprecation ...` to show where the warning was created)
|
||||
---tty-stream-chunk-separator
|
||||
[32m✔[39m passes needle
|
||||
---tty-stream-chunk-separator
|
||||
|
|
|
|||
|
|
@ -1,32 +0,0 @@
|
|||
|
||||
---tty-stream-chunk-separator
|
||||
[32m✔[39m test [90m[2m›[22m[39m passes
|
||||
---tty-stream-chunk-separator
|
||||
[90m─[39m
|
||||
|
||||
[32m1 test passed[39m [90m[2m[17:19:12][22m[39m
|
||||
|
||||
---tty-stream-chunk-separator
|
||||
[90m[2m────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────[22m[39m
|
||||
---tty-stream-chunk-separator
|
||||
|
||||
---tty-stream-chunk-separator
|
||||
[32m✔[39m test [90m[2m›[22m[39m passes
|
||||
---tty-stream-chunk-separator
|
||||
[90m─[39m
|
||||
|
||||
[32m1 test passed[39m [90m[2m[17:19:12][22m[39m
|
||||
[31m2 previous failures in test files that were not rerun[39m
|
||||
|
||||
---tty-stream-chunk-separator
|
||||
[90m[2m────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────[22m[39m
|
||||
---tty-stream-chunk-separator
|
||||
|
||||
---tty-stream-chunk-separator
|
||||
[32m✔[39m test [90m[2m›[22m[39m passes
|
||||
---tty-stream-chunk-separator
|
||||
[90m─[39m
|
||||
|
||||
[32m1 test passed[39m [90m[2m[17:19:12][22m[39m
|
||||
|
||||
---tty-stream-chunk-separator
|
||||
|
|
@ -1,7 +1,4 @@
|
|||
|
||||
---tty-stream-chunk-separator
|
||||
(node:14138) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
|
||||
(Use `node --trace-deprecation ...` to show where the warning was created)
|
||||
---tty-stream-chunk-separator
|
||||
[32m✔[39m test [90m[2m›[22m[39m passes
|
||||
---tty-stream-chunk-separator
|
||||
|
|
@ -13,9 +10,6 @@
|
|||
[90m[2m────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────[22m[39m
|
||||
---tty-stream-chunk-separator
|
||||
|
||||
---tty-stream-chunk-separator
|
||||
(node:14143) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
|
||||
(Use `node --trace-deprecation ...` to show where the warning was created)
|
||||
---tty-stream-chunk-separator
|
||||
[32m✔[39m test [90m[2m›[22m[39m passes
|
||||
---tty-stream-chunk-separator
|
||||
|
|
@ -28,9 +22,6 @@
|
|||
[90m[2m────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────[22m[39m
|
||||
---tty-stream-chunk-separator
|
||||
|
||||
---tty-stream-chunk-separator
|
||||
(node:14145) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
|
||||
(Use `node --trace-deprecation ...` to show where the warning was created)
|
||||
---tty-stream-chunk-separator
|
||||
[32m✔[39m test [90m[2m›[22m[39m passes
|
||||
---tty-stream-chunk-separator
|
||||
|
|
|
|||
|
|
@ -5,9 +5,21 @@
|
|||
To update a specific set of files you can run:
|
||||
|
||||
```console
|
||||
UPDATE_REPORTER_LOG=1 npx tap -j3 test-tap/reporters/{default,tap}.js
|
||||
NODE_NO_WARNINGS=1 UPDATE_REPORTER_LOG=1 npx tap -j2 test-tap/reporters/{default,tap}.js
|
||||
```
|
||||
|
||||
You'll need to run this for each supported (major) Node.js version. Use your favorite Node.js version manager, such as [nvm](https://github.com/nvm-sh/nvm/) or [nodenv](https://github.com/nodenv/nodenv).
|
||||
You'll need to run this for each supported (major) Node.js version. Use your favorite Node.js version manager, such as [Volta](https://volta.sh/):
|
||||
|
||||
```console
|
||||
NODE_NO_WARNINGS=1 UPDATE_REPORTER_LOG=1 volta run --node 22 npx tap -j2 test-tap/reporters/{default,tap}.js
|
||||
NODE_NO_WARNINGS=1 UPDATE_REPORTER_LOG=1 volta run --node 20 npx tap -j2 test-tap/reporters/{default,tap}.js
|
||||
NODE_NO_WARNINGS=1 UPDATE_REPORTER_LOG=1 volta run --node 18 npx tap -j2 test-tap/reporters/{default,tap}.js
|
||||
```
|
||||
|
||||
Or, with some more shell scripting magic:
|
||||
|
||||
```console
|
||||
jq <package.json '.engines.node|split(" || ")|.[]' -r|NODE_NO_WARNINGS=1 UPDATE_REPORTER_LOG=1 xargs -I {} volta run --node {} npx tap -j2 test-tap/reporters/{default,tap}.js
|
||||
```
|
||||
|
||||
Make sure to commit any new files, and of course changed ones.
|
||||
|
|
|
|||
|
|
@ -1,42 +0,0 @@
|
|||
TAP version 13
|
||||
---tty-stream-chunk-separator
|
||||
not ok 1 - ~/test-tap/fixture/report/edgecases/ast-syntax-error.cjs:3
|
||||
---
|
||||
name: SyntaxError
|
||||
message: Unexpected token 'do'
|
||||
at: 'const fn = do {'
|
||||
...
|
||||
---tty-stream-chunk-separator
|
||||
not ok 2 - ast-syntax-error.cjs exited with a non-zero exit code: 1
|
||||
---tty-stream-chunk-separator
|
||||
not ok 3 - No tests found in ava-import-no-test-declaration.cjs
|
||||
---tty-stream-chunk-separator
|
||||
not ok 4 - TypeError: test is not a function
|
||||
---
|
||||
name: TypeError
|
||||
message: test is not a function
|
||||
at: >-
|
||||
Object.<anonymous>
|
||||
(~/test-tap/fixture/report/edgecases/import-and-use-test-member.cjs:3:1)
|
||||
...
|
||||
---tty-stream-chunk-separator
|
||||
not ok 5 - import-and-use-test-member.cjs exited with a non-zero exit code: 1
|
||||
---tty-stream-chunk-separator
|
||||
not ok 6 - No tests found in no-ava-import.cjs, make sure to import "ava" at the top of your test file
|
||||
---tty-stream-chunk-separator
|
||||
not ok 7 - Error: throws
|
||||
---
|
||||
name: Error
|
||||
message: throws
|
||||
at: 'Object.<anonymous> (~/test-tap/fixture/report/edgecases/throws.cjs:1:7)'
|
||||
...
|
||||
---tty-stream-chunk-separator
|
||||
not ok 8 - throws.cjs exited with a non-zero exit code: 1
|
||||
---tty-stream-chunk-separator
|
||||
|
||||
1..0
|
||||
# tests 0
|
||||
# pass 0
|
||||
# fail 8
|
||||
|
||||
---tty-stream-chunk-separator
|
||||
|
|
@ -1,8 +1,5 @@
|
|||
TAP version 13
|
||||
---tty-stream-chunk-separator
|
||||
(node:14139) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
|
||||
(Use `node --trace-deprecation ...` to show where the warning was created)
|
||||
---tty-stream-chunk-separator
|
||||
not ok 1 - ~/test-tap/fixture/report/edgecases/ast-syntax-error.cjs:3
|
||||
---
|
||||
name: SyntaxError
|
||||
|
|
@ -12,14 +9,8 @@ not ok 1 - ~/test-tap/fixture/report/edgecases/ast-syntax-error.cjs:3
|
|||
---tty-stream-chunk-separator
|
||||
not ok 2 - ast-syntax-error.cjs exited with a non-zero exit code: 1
|
||||
---tty-stream-chunk-separator
|
||||
(node:14142) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
|
||||
(Use `node --trace-deprecation ...` to show where the warning was created)
|
||||
---tty-stream-chunk-separator
|
||||
not ok 3 - No tests found in ava-import-no-test-declaration.cjs
|
||||
---tty-stream-chunk-separator
|
||||
(node:14144) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
|
||||
(Use `node --trace-deprecation ...` to show where the warning was created)
|
||||
---tty-stream-chunk-separator
|
||||
not ok 4 - TypeError: test is not a function
|
||||
---
|
||||
name: TypeError
|
||||
|
|
@ -31,17 +22,8 @@ not ok 4 - TypeError: test is not a function
|
|||
---tty-stream-chunk-separator
|
||||
not ok 5 - import-and-use-test-member.cjs exited with a non-zero exit code: 1
|
||||
---tty-stream-chunk-separator
|
||||
(node:14146) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
|
||||
(Use `node --trace-deprecation ...` to show where the warning was created)
|
||||
---tty-stream-chunk-separator
|
||||
not ok 6 - No tests found in no-ava-import.cjs, make sure to import "ava" at the top of your test file
|
||||
---tty-stream-chunk-separator
|
||||
(node:14148) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
|
||||
(Use `node --trace-deprecation ...` to show where the warning was created)
|
||||
---tty-stream-chunk-separator
|
||||
(node:14152) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
|
||||
(Use `node --trace-deprecation ...` to show where the warning was created)
|
||||
---tty-stream-chunk-separator
|
||||
not ok 7 - Error: throws
|
||||
---
|
||||
name: Error
|
||||
|
|
|
|||
|
|
@ -1,17 +0,0 @@
|
|||
TAP version 13
|
||||
---tty-stream-chunk-separator
|
||||
not ok 1 - a › fails
|
||||
---
|
||||
name: AssertionError
|
||||
assertion: t.fail()
|
||||
message: Test failed via `t.fail()`
|
||||
at: 'ExecutionContext.fail (/lib/assert.js:287:15)'
|
||||
...
|
||||
---tty-stream-chunk-separator
|
||||
|
||||
1..1
|
||||
# tests 1
|
||||
# pass 0
|
||||
# fail 1
|
||||
|
||||
---tty-stream-chunk-separator
|
||||
|
|
@ -1,8 +1,5 @@
|
|||
TAP version 13
|
||||
---tty-stream-chunk-separator
|
||||
(node:14128) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
|
||||
(Use `node --trace-deprecation ...` to show where the warning was created)
|
||||
---tty-stream-chunk-separator
|
||||
not ok 1 - a › fails
|
||||
---
|
||||
name: AssertionError
|
||||
|
|
|
|||
|
|
@ -1,19 +0,0 @@
|
|||
TAP version 13
|
||||
---tty-stream-chunk-separator
|
||||
not ok 1 - a › fails
|
||||
---
|
||||
name: AssertionError
|
||||
assertion: t.fail()
|
||||
message: Test failed via `t.fail()`
|
||||
at: 'ExecutionContext.fail (/lib/assert.js:287:15)'
|
||||
...
|
||||
---tty-stream-chunk-separator
|
||||
# 1 test remaining in a.cjs
|
||||
---tty-stream-chunk-separator
|
||||
|
||||
1..2
|
||||
# tests 2
|
||||
# pass 0
|
||||
# fail 2
|
||||
|
||||
---tty-stream-chunk-separator
|
||||
|
|
@ -1,8 +1,5 @@
|
|||
TAP version 13
|
||||
---tty-stream-chunk-separator
|
||||
(node:14131) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
|
||||
(Use `node --trace-deprecation ...` to show where the warning was created)
|
||||
---tty-stream-chunk-separator
|
||||
not ok 1 - a › fails
|
||||
---
|
||||
name: AssertionError
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
@ -1,13 +1,7 @@
|
|||
TAP version 13
|
||||
---tty-stream-chunk-separator
|
||||
(node:14132) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
|
||||
(Use `node --trace-deprecation ...` to show where the warning was created)
|
||||
---tty-stream-chunk-separator
|
||||
ok 1 - a › only
|
||||
---tty-stream-chunk-separator
|
||||
(node:14135) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
|
||||
(Use `node --trace-deprecation ...` to show where the warning was created)
|
||||
---tty-stream-chunk-separator
|
||||
ok 2 - b › passes
|
||||
---tty-stream-chunk-separator
|
||||
|
||||
|
|
|
|||
|
|
@ -1,258 +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.<anonymous> (~/test-tap/fixture/report/regular/bad-test-chain.cjs:3:13)'
|
||||
...
|
||||
---tty-stream-chunk-separator
|
||||
not ok 2 - bad-test-chain.cjs 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: t.deepEqual()
|
||||
details:
|
||||
'Difference (- actual, + expected):': |2-
|
||||
{
|
||||
a: {
|
||||
b: {
|
||||
foo: 'bar',
|
||||
},
|
||||
},
|
||||
+ c: {
|
||||
+ d: {
|
||||
+ e: {
|
||||
+ foo: 'bar',
|
||||
+ },
|
||||
+ },
|
||||
+ },
|
||||
}
|
||||
message: ''
|
||||
at: 'ExecutionContext.deepEqual (/lib/assert.js:339:15)'
|
||||
...
|
||||
---tty-stream-chunk-separator
|
||||
not ok 4 - nested-objects › format like with max depth 4
|
||||
---
|
||||
name: AssertionError
|
||||
assertion: t.like()
|
||||
details:
|
||||
'Difference (- actual, + expected):': |2-
|
||||
{
|
||||
a: {
|
||||
b: {
|
||||
- foo: 'bar',
|
||||
+ foo: 'qux',
|
||||
},
|
||||
},
|
||||
}
|
||||
message: ''
|
||||
at: 'ExecutionContext.like (/lib/assert.js:391:15)'
|
||||
...
|
||||
---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
|
||||
assertion: t.fail()
|
||||
message: Test failed via `t.fail()`
|
||||
at: 'ExecutionContext.fail (/lib/assert.js:287:15)'
|
||||
...
|
||||
---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
|
||||
assertion: t.fail()
|
||||
message: Test failed via `t.fail()`
|
||||
at: 'ExecutionContext.fail (/lib/assert.js:287:15)'
|
||||
...
|
||||
---tty-stream-chunk-separator
|
||||
ok 11 - test › known failure
|
||||
---tty-stream-chunk-separator
|
||||
not ok 12 - test › no longer failing
|
||||
---
|
||||
name: AssertionError
|
||||
message: >-
|
||||
Test was expected to fail, but succeeded, you should stop marking the test as
|
||||
failing
|
||||
at: 'Test.finish (/lib/test.js:633:28)'
|
||||
...
|
||||
---tty-stream-chunk-separator
|
||||
not ok 13 - test › logs
|
||||
# hello
|
||||
# world
|
||||
---
|
||||
name: AssertionError
|
||||
assertion: t.fail()
|
||||
message: Test failed via `t.fail()`
|
||||
at: 'ExecutionContext.fail (/lib/assert.js:287:15)'
|
||||
...
|
||||
---tty-stream-chunk-separator
|
||||
not ok 14 - test › formatted
|
||||
---
|
||||
name: AssertionError
|
||||
assertion: t.deepEqual()
|
||||
details:
|
||||
'Difference (- actual, + expected):': |-
|
||||
- 'foo'
|
||||
+ 'bar'
|
||||
message: ''
|
||||
at: 'ExecutionContext.deepEqual (/lib/assert.js:339:15)'
|
||||
...
|
||||
---tty-stream-chunk-separator
|
||||
not ok 15 - test › implementation throws non-error
|
||||
---
|
||||
name: AssertionError
|
||||
details:
|
||||
'Error thrown in test:': 'null'
|
||||
message: Error thrown in test
|
||||
at: 'Test.run (/lib/test.js:546:25)'
|
||||
...
|
||||
---tty-stream-chunk-separator
|
||||
not ok 16 - traces-in-t-throws › throws
|
||||
---
|
||||
name: AssertionError
|
||||
assertion: t.throws()
|
||||
details:
|
||||
'Function threw unexpected exception:': |-
|
||||
Error {
|
||||
message: 'uh-oh',
|
||||
}
|
||||
'Expected instance of:': 'Function TypeError {}'
|
||||
message: ''
|
||||
at: 'throwError (~/test-tap/fixture/report/regular/traces-in-t-throws.cjs:4:8)'
|
||||
...
|
||||
---tty-stream-chunk-separator
|
||||
not ok 17 - traces-in-t-throws › notThrows
|
||||
---
|
||||
name: AssertionError
|
||||
assertion: t.notThrows()
|
||||
details:
|
||||
'Function threw:': |-
|
||||
Error {
|
||||
message: 'uh-oh',
|
||||
}
|
||||
message: ''
|
||||
at: 'throwError (~/test-tap/fixture/report/regular/traces-in-t-throws.cjs:4:8)'
|
||||
...
|
||||
---tty-stream-chunk-separator
|
||||
not ok 18 - traces-in-t-throws › notThrowsAsync
|
||||
---
|
||||
name: AssertionError
|
||||
assertion: t.notThrowsAsync()
|
||||
details:
|
||||
'Function threw:': |-
|
||||
Error {
|
||||
message: 'uh-oh',
|
||||
}
|
||||
message: ''
|
||||
at: 'throwError (~/test-tap/fixture/report/regular/traces-in-t-throws.cjs:4:8)'
|
||||
...
|
||||
---tty-stream-chunk-separator
|
||||
not ok 19 - traces-in-t-throws › throwsAsync
|
||||
---
|
||||
name: AssertionError
|
||||
assertion: t.throwsAsync()
|
||||
details:
|
||||
'Function threw synchronously. Use `t.throws()` instead:': |-
|
||||
Error {
|
||||
message: 'uh-oh',
|
||||
}
|
||||
message: ''
|
||||
at: 'throwError (~/test-tap/fixture/report/regular/traces-in-t-throws.cjs:4:8)'
|
||||
...
|
||||
---tty-stream-chunk-separator
|
||||
not ok 20 - traces-in-t-throws › throwsAsync different error
|
||||
---
|
||||
name: AssertionError
|
||||
assertion: t.throwsAsync()
|
||||
details:
|
||||
'Returned promise rejected with unexpected exception:': |-
|
||||
Error {
|
||||
message: 'uh-oh',
|
||||
}
|
||||
'Expected instance of:': 'Function TypeError {}'
|
||||
message: ''
|
||||
at: >-
|
||||
returnRejectedPromise
|
||||
(~/test-tap/fixture/report/regular/traces-in-t-throws.cjs:8:24)
|
||||
...
|
||||
---tty-stream-chunk-separator
|
||||
ok 21 - uncaught-exception › passes
|
||||
---tty-stream-chunk-separator
|
||||
not ok 22 - Error: Can’t catch me
|
||||
---
|
||||
name: Error
|
||||
message: Can’t catch me
|
||||
at: >-
|
||||
Immediate.<anonymous>
|
||||
(~/test-tap/fixture/report/regular/uncaught-exception.cjs:5:9)
|
||||
...
|
||||
---tty-stream-chunk-separator
|
||||
not ok 23 - uncaught-exception.cjs exited with a non-zero exit code: 1
|
||||
---tty-stream-chunk-separator
|
||||
ok 24 - unhandled-rejection › passes
|
||||
---tty-stream-chunk-separator
|
||||
ok 25 - unhandled-rejection › unhandled non-error rejection
|
||||
---tty-stream-chunk-separator
|
||||
not ok 26 - Error: Can’t catch me
|
||||
---
|
||||
name: Error
|
||||
message: Can’t catch me
|
||||
at: 'passes (~/test-tap/fixture/report/regular/unhandled-rejection.cjs:4:17)'
|
||||
...
|
||||
---tty-stream-chunk-separator
|
||||
not ok 27 - unhandled-rejection
|
||||
---
|
||||
message: Non-native error
|
||||
formatted: 'null'
|
||||
...
|
||||
---tty-stream-chunk-separator
|
||||
not ok 28 - unhandled-rejection.cjs exited with a non-zero exit code: 1
|
||||
---tty-stream-chunk-separator
|
||||
|
||||
1..21
|
||||
# tests 20
|
||||
# pass 6
|
||||
# skip 1
|
||||
# fail 21
|
||||
|
||||
---tty-stream-chunk-separator
|
||||
|
|
@ -1,8 +1,5 @@
|
|||
TAP version 13
|
||||
---tty-stream-chunk-separator
|
||||
(node:14113) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
|
||||
(Use `node --trace-deprecation ...` to show where the warning was created)
|
||||
---tty-stream-chunk-separator
|
||||
not ok 1 - TypeError: test.serial.test is not a function
|
||||
---
|
||||
name: TypeError
|
||||
|
|
@ -12,9 +9,6 @@ not ok 1 - TypeError: test.serial.test is not a function
|
|||
---tty-stream-chunk-separator
|
||||
not ok 2 - bad-test-chain.cjs exited with a non-zero exit code: 1
|
||||
---tty-stream-chunk-separator
|
||||
(node:14116) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
|
||||
(Use `node --trace-deprecation ...` to show where the warning was created)
|
||||
---tty-stream-chunk-separator
|
||||
not ok 3 - nested-objects › format with max depth 4
|
||||
---
|
||||
name: AssertionError
|
||||
|
|
@ -57,9 +51,6 @@ not ok 4 - nested-objects › format like with max depth 4
|
|||
at: 'ExecutionContext.like (/lib/assert.js:391:15)'
|
||||
...
|
||||
---tty-stream-chunk-separator
|
||||
(node:14118) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
|
||||
(Use `node --trace-deprecation ...` to show where the warning was created)
|
||||
---tty-stream-chunk-separator
|
||||
# output-in-hook › before hook
|
||||
---tty-stream-chunk-separator
|
||||
# output-in-hook › before hook
|
||||
|
|
@ -100,9 +91,6 @@ not ok 6 - output-in-hook › failing test
|
|||
---tty-stream-chunk-separator
|
||||
# afterAlways
|
||||
---tty-stream-chunk-separator
|
||||
(node:14120) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
|
||||
(Use `node --trace-deprecation ...` to show where the warning was created)
|
||||
---tty-stream-chunk-separator
|
||||
ok 7 - test › skip # SKIP
|
||||
---tty-stream-chunk-separator
|
||||
not ok 8 - test › todo # TODO
|
||||
|
|
@ -159,9 +147,6 @@ not ok 15 - test › implementation throws non-error
|
|||
at: 'Test.run (/lib/test.js:546:25)'
|
||||
...
|
||||
---tty-stream-chunk-separator
|
||||
(node:14123) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
|
||||
(Use `node --trace-deprecation ...` to show where the warning was created)
|
||||
---tty-stream-chunk-separator
|
||||
not ok 16 - traces-in-t-throws › throws
|
||||
---
|
||||
name: AssertionError
|
||||
|
|
@ -231,9 +216,6 @@ not ok 20 - traces-in-t-throws › throwsAsync different error
|
|||
(~/test-tap/fixture/report/regular/traces-in-t-throws.cjs:8:24)
|
||||
...
|
||||
---tty-stream-chunk-separator
|
||||
(node:14125) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
|
||||
(Use `node --trace-deprecation ...` to show where the warning was created)
|
||||
---tty-stream-chunk-separator
|
||||
ok 21 - uncaught-exception › passes
|
||||
---tty-stream-chunk-separator
|
||||
not ok 22 - Error: Can’t catch me
|
||||
|
|
@ -247,9 +229,6 @@ not ok 22 - Error: Can’t catch me
|
|||
---tty-stream-chunk-separator
|
||||
not ok 23 - uncaught-exception.cjs exited with a non-zero exit code: 1
|
||||
---tty-stream-chunk-separator
|
||||
(node:14127) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
|
||||
(Use `node --trace-deprecation ...` to show where the warning was created)
|
||||
---tty-stream-chunk-separator
|
||||
ok 24 - unhandled-rejection › passes
|
||||
---tty-stream-chunk-separator
|
||||
ok 25 - unhandled-rejection › unhandled non-error rejection
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import {Buffer} from 'node:buffer';
|
||||
import {on} from 'node:events';
|
||||
import path from 'node:path';
|
||||
import {Writable} from 'node:stream';
|
||||
import {fileURLToPath, pathToFileURL} from 'node:url';
|
||||
|
|
@ -79,6 +78,8 @@ const sortStats = stats => {
|
|||
};
|
||||
|
||||
export async function * exec(args, options) {
|
||||
let {errors, logs, stats, stdout, stderr} = initState();
|
||||
|
||||
const workingDir = options.cwd ?? cwd();
|
||||
const execaProcess = execaNode(cliPath, args, {
|
||||
...options,
|
||||
|
|
@ -89,32 +90,31 @@ export async function * exec(args, options) {
|
|||
TEST_AVA_REQUIRE_FROM,
|
||||
},
|
||||
cwd: workingDir,
|
||||
serialization: 'advanced',
|
||||
nodeOptions: ['--require', ttySimulator],
|
||||
stdout: ['pipe', new Writable({
|
||||
write(chunk, encoding, callback) {
|
||||
stdout += chunk;
|
||||
callback();
|
||||
},
|
||||
})],
|
||||
stderr: ['pipe', new Writable({
|
||||
write(chunk, encoding, callback) {
|
||||
stderr += chunk;
|
||||
|
||||
// Besides buffering stderr, if this environment variable is set, also pipe
|
||||
// to stderr. This can be useful when debugging the tests.
|
||||
if (process.env.DEBUG_TEST_AVA) {
|
||||
forwardErrorOutput(chunk);
|
||||
}
|
||||
|
||||
callback();
|
||||
},
|
||||
})],
|
||||
});
|
||||
|
||||
let {errors, logs, stats, stdout, stderr} = initState();
|
||||
|
||||
execaProcess.pipeStdout(new Writable({
|
||||
write(chunk) {
|
||||
stdout += chunk;
|
||||
},
|
||||
}));
|
||||
execaProcess.pipeStderr(new Writable({
|
||||
write(chunk) {
|
||||
stderr += chunk;
|
||||
|
||||
// Besides buffering stderr, if this environment variable is set, also pipe
|
||||
// to stderr. This can be useful when debugging the tests.
|
||||
if (process.env.DEBUG_TEST_AVA) {
|
||||
forwardErrorOutput(chunk);
|
||||
}
|
||||
},
|
||||
}));
|
||||
|
||||
let runCount = 0;
|
||||
const statusEvents = on(execaProcess, 'message');
|
||||
const done = execaProcess.then(result => ({execa: true, result}), error => {
|
||||
const statusEvents = execaProcess.getEachMessage();
|
||||
const done = execaProcess.then(result => ({execa: true, result}), error => { // eslint-disable-line promise/prefer-await-to-then
|
||||
sortStats(stats);
|
||||
throw Object.assign(error, {stats, runCount});
|
||||
});
|
||||
|
|
@ -133,7 +133,7 @@ export async function * exec(args, options) {
|
|||
break;
|
||||
}
|
||||
|
||||
const {value: [statusEvent]} = item;
|
||||
const {value: statusEvent} = item;
|
||||
switch (statusEvent.type) {
|
||||
case 'end': {
|
||||
sortStats(stats);
|
||||
|
|
|
|||
|
|
@ -7,6 +7,6 @@ test('availability', async t => {
|
|||
});
|
||||
|
||||
test('teardown', async t => {
|
||||
const result = await fixture('teardown.js');
|
||||
const result = await fixture(['teardown.js']);
|
||||
t.true(result.stderr.includes('TEARDOWN CALLED'));
|
||||
});
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import {fixture} from '../helpers/exec.js';
|
|||
test('process.exit is intercepted', async t => {
|
||||
const result = await t.throwsAsync(fixture(['process-exit.js']));
|
||||
t.true(result.failed);
|
||||
t.like(result, {timedOut: false, isCanceled: false, killed: false});
|
||||
t.like(result, {timedOut: false, isCanceled: false, isTerminated: false});
|
||||
t.is(result.stats.selectedTestCount, 3);
|
||||
t.is(result.stats.passed.length, 2);
|
||||
t.is(result.stats.processExits.length, 1);
|
||||
|
|
|
|||
Loading…
Reference in a new issue