diff --git a/lib/beautify-stack.js b/lib/beautify-stack.js deleted file mode 100644 index 96206d605..000000000 --- a/lib/beautify-stack.js +++ /dev/null @@ -1,75 +0,0 @@ -'use strict'; -const StackUtils = require('stack-utils'); -const cleanStack = require('clean-stack'); -const debug = require('debug')('ava'); - -// Ignore unimportant stack trace lines -let ignoreStackLines = []; - -const avaInternals = /\/ava\/(?:lib\/|lib\/worker\/)?[\w-]+\.js:\d+:\d+\)?$/; -const avaDependencies = /\/node_modules\/(?:@ava\/babel|@ava\/require-precompiled|append-transform|empower-core|nyc|require-precompiled|(?:ava\/node_modules\/)?(?:babel-runtime|core-js))\//; -const stackFrameLine = /^.+( \(.+:\d+:\d+\)|:\d+:\d+)$/; - -if (!debug.enabled) { - ignoreStackLines = StackUtils.nodeInternals(); - ignoreStackLines.push(avaInternals); - ignoreStackLines.push(avaDependencies); -} - -const stackUtils = new StackUtils({internals: ignoreStackLines}); - -function extractFrames(stack) { - return stack - .split('\n') - .map(line => line.trim()) - .filter(line => stackFrameLine.test(line)) - .join('\n'); -} - -/* - * Given a string value of the format generated for the `stack` property of a - * V8 error object, return a string that contains only stack frame information - * for frames that have relevance to the consumer. - * - * For example, given the following string value: - * - * ``` - * Error - * at inner (/home/ava/ex.js:7:12) - * at /home/ava/ex.js:12:5 - * at outer (/home/ava/ex.js:13:4) - * at Object. (/home/ava/ex.js:14:3) - * at Module._compile (module.js:570:32) - * at Object.Module._extensions..js (module.js:579:10) - * at Module.load (module.js:487:32) - * at tryModuleLoad (module.js:446:12) - * at Function.Module._load (module.js:438:3) - * at Module.runMain (module.js:604:10) - * ``` - * - * ...this function returns the following string value: - * - * ``` - * inner (/home/ava/ex.js:7:12) - * /home/ava/ex.js:12:5 - * outer (/home/ava/ex.js:13:4) - * Object. (/home/ava/ex.js:14:3) - * ``` - */ -module.exports = stack => { - if (!stack) { - return ''; - } - - stack = extractFrames(stack); - // Workaround for https://github.com/tapjs/stack-utils/issues/14 - // TODO: fix it in `stack-utils` - stack = cleanStack(stack); - - return stackUtils.clean(stack) - // Remove the trailing newline inserted by the `stack-utils` module - .trim() - // Remove remaining file:// prefixes, inserted by `esm`, that are not - // cleaned up by `stack-utils` - .split('\n').map(line => line.replace(/\(file:\/\/(?[^/].+:\d+:\d+)\)$/, '($)')).join('\n'); -}; diff --git a/lib/reporters/beautify-stack.js b/lib/reporters/beautify-stack.js new file mode 100644 index 000000000..858da35e0 --- /dev/null +++ b/lib/reporters/beautify-stack.js @@ -0,0 +1,69 @@ +'use strict'; +const StackUtils = require('stack-utils'); + +const stackUtils = new StackUtils({ + ignoredPackages: [ + '@ava/babel', + '@ava/require-precompiled', + '@ava/typescript', + 'append-transform', + 'ava', + 'empower-core', + 'esm', + 'nyc' + ], + internals: [ + // AVA internals, which ignoredPackages don't ignore when we run our own unit tests. + /\/ava\/(?:lib\/|lib\/worker\/)?[\w-]+\.js:\d+:\d+\)?$/, + // Only ignore Node.js internals that really are not useful for debugging. + ...StackUtils.nodeInternals().filter(regexp => !/\(internal/.test(regexp.source)), + /\(internal\/process\/task_queues\.js:\d+:\d+\)$/, + /\(internal\/modules\/cjs\/.+?\.js:\d+:\d+\)$/, + /async Promise\.all \(index/, + /new Promise \(\)/ + ] +}); + +/* + * Given a string value of the format generated for the `stack` property of a + * V8 error object, return a string that contains only stack frame information + * for frames that have relevance to the consumer. + * + * For example, given the following string value: + * + * ``` + * Error + * at inner (/home/ava/ex.js:7:12) + * at /home/ava/ex.js:12:5 + * at outer (/home/ava/ex.js:13:4) + * at Object. (/home/ava/ex.js:14:3) + * at Module._compile (module.js:570:32) + * at Object.Module._extensions..js (module.js:579:10) + * at Module.load (module.js:487:32) + * at tryModuleLoad (module.js:446:12) + * at Function.Module._load (module.js:438:3) + * at Module.runMain (module.js:604:10) + * ``` + * + * ...this function returns the following string value: + * + * ``` + * inner (/home/ava/ex.js:7:12) + * /home/ava/ex.js:12:5 + * outer (/home/ava/ex.js:13:4) + * Object. (/home/ava/ex.js:14:3) + * Module._compile (module.js:570:32) + * Object.Module._extensions..js (module.js:579:10) + * Module.load (module.js:487:32) + * tryModuleLoad (module.js:446:12) + * Function.Module._load (module.js:438:3) + * Module.runMain (module.js:604:10) + * ``` + */ +module.exports = stack => { + if (!stack) { + return []; + } + + return stackUtils.clean(stack).trim().split('\n'); +}; diff --git a/lib/reporters/colors.js b/lib/reporters/colors.js index a03dbaead..31d0ec912 100644 --- a/lib/reporters/colors.js +++ b/lib/reporters/colors.js @@ -11,6 +11,7 @@ module.exports = { duration: chalk.gray.dim, errorSource: chalk.gray, errorStack: chalk.gray, + errorStackInternal: chalk.gray.dim, stack: chalk.red, information: chalk.magenta }; diff --git a/lib/reporters/mini.js b/lib/reporters/mini.js index 32e58fd41..dd39f9dcf 100644 --- a/lib/reporters/mini.js +++ b/lib/reporters/mini.js @@ -9,6 +9,7 @@ const indentString = require('indent-string'); const ora = require('ora'); const plur = require('plur'); const trimOffNewlines = require('trim-off-newlines'); +const beautifyStack = require('./beautify-stack'); const chalk = require('../chalk').get(); const codeExcerpt = require('../code-excerpt'); @@ -18,6 +19,8 @@ const improperUsageMessages = require('./improper-usage-messages'); const prefixTitle = require('./prefix-title'); const whileCorked = require('./while-corked'); +const nodeInternals = require('stack-utils').nodeInternals(); + class LineWriter extends stream.Writable { constructor(dest, spinner) { super(); @@ -322,13 +325,27 @@ class MiniReporter { if (evt.err.stack) { const {stack} = evt.err; - if (stack.includes(os.EOL)) { + if (stack.includes('\n')) { this.lineWriter.writeLine(); - this.lineWriter.writeLine(colors.errorStack(stack)); + this.lineWriter.writeLine(this.formatErrorStack(evt.err)); } } } + formatErrorStack(error) { + if (error.shouldBeautifyStack) { + return beautifyStack(error.stack).map(line => { + if (nodeInternals.some(internal => internal.test(line))) { + return colors.errorStackInternal(`${figures.pointerSmall} ${line}`); + } + + return colors.errorStack(`${figures.pointerSmall} ${line}`); + }).join('\n'); + } + + return error.stack; + } + writeLogs(evt) { if (evt.logs) { for (const log of evt.logs) { diff --git a/lib/reporters/tap.js b/lib/reporters/tap.js index 0c9998728..ac2929e5c 100644 --- a/lib/reporters/tap.js +++ b/lib/reporters/tap.js @@ -7,6 +7,7 @@ const stripAnsi = require('strip-ansi'); const supertap = require('supertap'); const indentString = require('indent-string'); +const beautifyStack = require('./beautify-stack'); const prefixTitle = require('./prefix-title'); function dumpError(error) { @@ -42,7 +43,7 @@ function dumpError(error) { } if (error.stack) { - object.at = error.stack; + object.at = error.shouldBeautifyStack ? beautifyStack(error.stack).join('\n') : error.stack; } return object; diff --git a/lib/reporters/verbose.js b/lib/reporters/verbose.js index 9e7158c1b..35a511bdd 100644 --- a/lib/reporters/verbose.js +++ b/lib/reporters/verbose.js @@ -8,6 +8,7 @@ const indentString = require('indent-string'); const plur = require('plur'); const prettyMs = require('pretty-ms'); const trimOffNewlines = require('trim-off-newlines'); +const beautifyStack = require('./beautify-stack'); const chalk = require('../chalk').get(); const codeExcerpt = require('../code-excerpt'); @@ -17,6 +18,8 @@ const improperUsageMessages = require('./improper-usage-messages'); const prefixTitle = require('./prefix-title'); const whileCorked = require('./while-corked'); +const nodeInternals = require('stack-utils').nodeInternals(); + class LineWriter extends stream.Writable { constructor(dest) { super(); @@ -263,11 +266,25 @@ class VerboseReporter { const {stack} = evt.err; if (stack.includes('\n')) { this.lineWriter.writeLine(); - this.lineWriter.writeLine(colors.errorStack(stack)); + this.lineWriter.writeLine(this.formatErrorStack(evt.err)); } } } + formatErrorStack(error) { + if (error.shouldBeautifyStack) { + return beautifyStack(error.stack).map(line => { + if (nodeInternals.some(internal => internal.test(line))) { + return colors.errorStackInternal(`${figures.pointerSmall} ${line}`); + } + + return colors.errorStack(`${figures.pointerSmall} ${line}`); + }).join('\n'); + } + + return error.stack; + } + writePendingTests(evt) { for (const [file, testsInFile] of evt.pendingTests) { if (testsInFile.size === 0) { diff --git a/lib/runner.js b/lib/runner.js index f1a221a36..bd93042e8 100644 --- a/lib/runner.js +++ b/lib/runner.js @@ -347,7 +347,7 @@ class Runner extends Emittery { this.emit('stateChange', { type: 'test-failed', title: result.title, - err: serializeError('Test failure', true, result.error), + err: serializeError('Test failure', true, result.error, this.file), duration: result.duration, knownFailing: result.metadata.failing, logs: result.logs diff --git a/lib/serialize-error.js b/lib/serialize-error.js index 114b9a28e..3a6e24078 100644 --- a/lib/serialize-error.js +++ b/lib/serialize-error.js @@ -3,9 +3,9 @@ const path = require('path'); const cleanYamlObject = require('clean-yaml-object'); const concordance = require('concordance'); const isError = require('is-error'); +const slash = require('slash'); const StackUtils = require('stack-utils'); const assert = require('./assert'); -const beautifyStack = require('./beautify-stack'); const concordanceOptions = require('./concordance-options').default; function isAvaAssertionError(source) { @@ -17,13 +17,29 @@ function filter(propertyName, isRoot) { } const stackUtils = new StackUtils(); -function extractSource(stack) { - if (!stack) { +function extractSource(stack, testFile) { + if (!stack || !testFile) { return null; } - const firstStackLine = stack.split('\n')[0]; - return stackUtils.parseLine(firstStackLine); + // Normalize the test file so it matches `callSite.file`. + const relFile = path.relative(process.cwd(), testFile); + const normalizedFile = process.platform === 'win32' ? slash(relFile) : relFile; + for (const line of stack.split('\n')) { + try { + const callSite = stackUtils.parseLine(line); + if (callSite.file === normalizedFile) { + return { + isDependency: false, + isWithinProject: true, + file: path.resolve(process.cwd(), callSite.file), + line: callSite.line + }; + } + } catch {} + } + + return null; } function buildSource(source) { @@ -51,22 +67,19 @@ function buildSource(source) { }; } -function trySerializeError(err, shouldBeautifyStack) { - let stack = err.savedError ? err.savedError.stack : err.stack; - - if (shouldBeautifyStack) { - stack = beautifyStack(stack); - } +function trySerializeError(err, shouldBeautifyStack, testFile) { + const stack = err.savedError ? err.savedError.stack : err.stack; const retval = { avaAssertionError: isAvaAssertionError(err), nonErrorObject: false, - source: buildSource(extractSource(stack)), - stack + source: extractSource(stack, testFile), + stack, + shouldBeautifyStack }; if (err.actualStack) { - retval.stack = shouldBeautifyStack ? beautifyStack(err.actualStack) : err.actualStack; + retval.stack = err.actualStack; } if (retval.avaAssertionError) { @@ -133,7 +146,7 @@ function trySerializeError(err, shouldBeautifyStack) { return retval; } -function serializeError(origin, shouldBeautifyStack, err) { +function serializeError(origin, shouldBeautifyStack, err, testFile) { if (!isError(err)) { return { avaAssertionError: false, @@ -143,8 +156,8 @@ function serializeError(origin, shouldBeautifyStack, err) { } try { - return trySerializeError(err, shouldBeautifyStack); - } catch (_) { + return trySerializeError(err, shouldBeautifyStack, testFile); + } catch { const replacement = new Error(`${origin}: Could not serialize error`); return { avaAssertionError: false, diff --git a/lib/worker/subprocess.js b/lib/worker/subprocess.js index b6477428c..d22081af4 100644 --- a/lib/worker/subprocess.js +++ b/lib/worker/subprocess.js @@ -70,7 +70,7 @@ ipc.options.then(async options => { runner.on('stateChange', state => ipc.send(state)); runner.on('error', error => { - ipc.send({type: 'internal-error', err: serializeError('Internal runner error', false, error)}); + ipc.send({type: 'internal-error', err: serializeError('Internal runner error', false, error, runner.file)}); exit(1); }); @@ -81,7 +81,7 @@ ipc.options.then(async options => { ipc.send({type: 'touched-files', files: touchedFiles}); } } catch (error) { - ipc.send({type: 'internal-error', err: serializeError('Internal runner error', false, error)}); + ipc.send({type: 'internal-error', err: serializeError('Internal runner error', false, error, runner.file)}); exit(1); return; } @@ -90,7 +90,7 @@ ipc.options.then(async options => { currentlyUnhandled() .filter(rejection => !attributedRejections.has(rejection.promise)) .forEach(rejection => { - ipc.send({type: 'unhandled-rejection', err: serializeError('Unhandled rejection', true, rejection.reason)}); + ipc.send({type: 'unhandled-rejection', err: serializeError('Unhandled rejection', true, rejection.reason, runner.file)}); }); exit(0); @@ -102,7 +102,7 @@ ipc.options.then(async options => { return; } - ipc.send({type: 'uncaught-exception', err: serializeError('Uncaught exception', true, error)}); + ipc.send({type: 'uncaught-exception', err: serializeError('Uncaught exception', true, error, runner.file)}); exit(1); }); @@ -207,7 +207,7 @@ ipc.options.then(async options => { exit(1); } } catch (error) { - ipc.send({type: 'uncaught-exception', err: serializeError('Uncaught exception', true, error)}); + ipc.send({type: 'uncaught-exception', err: serializeError('Uncaught exception', true, error, runner.file)}); exit(1); } }).catch(error => { diff --git a/package.json b/package.json index 5f54037eb..9d78e8d2a 100644 --- a/package.json +++ b/package.json @@ -64,7 +64,6 @@ "chunkd": "^2.0.1", "ci-info": "^2.0.0", "ci-parallel-vars": "^1.0.0", - "clean-stack": "^2.2.0", "clean-yaml-object": "^0.1.0", "cli-cursor": "^3.1.0", "cli-truncate": "^2.1.0", diff --git a/test-tap/beautify-stack.js b/test-tap/beautify-stack.js deleted file mode 100644 index c8ef34032..000000000 --- a/test-tap/beautify-stack.js +++ /dev/null @@ -1,78 +0,0 @@ -'use strict'; -require('../lib/chalk').set(); -require('../lib/worker/options').set({}); - -const proxyquire = require('proxyquire').noPreserveCache(); -const {test} = require('tap'); -const Runner = require('../lib/runner'); - -const beautifyStack = proxyquire('../lib/beautify-stack', { - debug() { - return { - enabled: false - }; - } -}); - -function fooFunc() { - barFunc(); -} - -function barFunc() { - throw new Error(); // eslint-disable-line unicorn/error-message -} - -test('does not strip ava internals and dependencies from stack trace with debug enabled', t => { - const beautify = proxyquire('../lib/beautify-stack', { - debug() { - return { - enabled: true - }; - } - }); - - const result = beautify( - 'Error: TypeError\n' + - 'at null._onTimeout (node_modules/ava/cli.js:27:11)\n' + - 'at Stub.listOnTimeout (timers.js:119:15)\n' - ); - - t.true(result.includes('ava/cli.js')); - t.end(); -}); - -test('strips ava internals and dependencies from stack trace with debug disabled', t => { - const result = beautifyStack( - 'Error: TypeError\n' + - 'at null._onTimeout (node_modules/ava/cli.js:27:11)\n' + - 'at Stub.listOnTimeout (timers.js:119:15)\n' - ); - - t.false(result.includes('ava/cli.js')); - t.end(); -}); - -test('returns empty string without any arguments', t => { - t.is(beautifyStack(), ''); - t.end(); -}); - -test('beautify stack - removes uninteresting lines', async t => { - try { - const runner = new Runner(); - await runner.runSingle({ - run() { - fooFunc(); - } - }); - } catch (error) { - const stack = beautifyStack(error.stack); - t.match(stack, /fooFunc/); - t.match(stack, /barFunc/); - // The runSingle line is introduced by Runner. It's internal so it should - // be stripped. - t.match(error.stack, /runSingle/); - t.notMatch(stack, /runSingle/); - t.end(); - } -}); diff --git a/test-tap/helper/report.js b/test-tap/helper/report.js index 109adcbe6..7b79c733a 100644 --- a/test-tap/helper/report.js +++ b/test-tap/helper/report.js @@ -62,8 +62,6 @@ exports.sanitizers = { lineEndings: string => replaceString(string, '\r\n', '\n'), posix: string => replaceString(string, '\\', '/'), slow: string => string.replace(/(?slow.+?)\(\d+m?s\)/g, '$ (000ms)'), - timeout: string => replaceString(string, 'Timeout._onTimeout', 'Timeout.setTimeout'), - traces: string => string.replace(/(\[...)?[^\s'[]+\s\((.+\.js:\d+:\d+)\)/g, '$1$2'), version: string => replaceString(string, `v${pkg.version}`, 'v1.0.0-beta.5.1') }; diff --git a/test-tap/reporters/mini.edgecases.log b/test-tap/reporters/mini.edgecases.v10.log similarity index 86% rename from test-tap/reporters/mini.edgecases.log rename to test-tap/reporters/mini.edgecases.v10.log index 992deae88..0a481d9dd 100644 --- a/test-tap/reporters/mini.edgecases.log +++ b/test-tap/reporters/mini.edgecases.v10.log @@ -25,6 +25,8 @@ 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 @@ -36,4 +38,6 @@ Error: throws + › Object. (test-tap/fixture/report/edgecases/throws.js:1:7) + ---tty-stream-chunk-separator diff --git a/test-tap/reporters/mini.edgecases.v12.log b/test-tap/reporters/mini.edgecases.v12.log new file mode 100644 index 000000000..0a481d9dd --- /dev/null +++ b/test-tap/reporters/mini.edgecases.v12.log @@ -0,0 +1,43 @@ +[?25l---tty-stream-chunk-separator + +---tty-stream-chunk-separator +* ---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 +[?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 + + 2 uncaught exceptions + + 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) + +---tty-stream-chunk-separator diff --git a/test-tap/reporters/mini.edgecases.v13.log b/test-tap/reporters/mini.edgecases.v13.log new file mode 100644 index 000000000..0a481d9dd --- /dev/null +++ b/test-tap/reporters/mini.edgecases.v13.log @@ -0,0 +1,43 @@ +[?25l---tty-stream-chunk-separator + +---tty-stream-chunk-separator +* ---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 +[?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 + + 2 uncaught exceptions + + 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) + +---tty-stream-chunk-separator diff --git a/test-tap/reporters/mini.failfast.v10.log b/test-tap/reporters/mini.failfast.v10.log new file mode 100644 index 000000000..9aff997b2 --- /dev/null +++ b/test-tap/reporters/mini.failfast.v10.log @@ -0,0 +1,30 @@ +[?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 + 1 test failed + + 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) + › process._tickCallback (internal/process/next_tick.js:68:7) + + + + `--fail-fast` is on. 1 test file was skipped. + +---tty-stream-chunk-separator diff --git a/test-tap/reporters/mini.failfast.log b/test-tap/reporters/mini.failfast.v12.log similarity index 91% rename from test-tap/reporters/mini.failfast.log rename to test-tap/reporters/mini.failfast.v12.log index f9f8acf99..f85522dd9 100644 --- a/test-tap/reporters/mini.failfast.log +++ b/test-tap/reporters/mini.failfast.v12.log @@ -20,6 +20,8 @@ Test failed via `t.fail()` + › test-tap/fixture/report/failfast/a.js:3:22 + `--fail-fast` is on. 1 test file was skipped. diff --git a/test-tap/reporters/mini.failfast.v13.log b/test-tap/reporters/mini.failfast.v13.log new file mode 100644 index 000000000..f85522dd9 --- /dev/null +++ b/test-tap/reporters/mini.failfast.v13.log @@ -0,0 +1,29 @@ +[?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 + 1 test failed + + a › fails + + a.js:3 + + 2: +  3: test('fails', t => t.fail()); + 4: + + Test failed via `t.fail()` + + › test-tap/fixture/report/failfast/a.js:3:22 + + + + `--fail-fast` is on. 1 test file was skipped. + +---tty-stream-chunk-separator diff --git a/test-tap/reporters/mini.failfast2.v10.log b/test-tap/reporters/mini.failfast2.v10.log new file mode 100644 index 000000000..d132dab14 --- /dev/null +++ b/test-tap/reporters/mini.failfast2.v10.log @@ -0,0 +1,30 @@ +[?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 + 1 test failed + + 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) + › process._tickCallback (internal/process/next_tick.js:68:7) + + + + `--fail-fast` is on. At least 1 test was skipped, as well as 1 test file. + +---tty-stream-chunk-separator diff --git a/test-tap/reporters/mini.failfast2.log b/test-tap/reporters/mini.failfast2.v12.log similarity index 91% rename from test-tap/reporters/mini.failfast2.log rename to test-tap/reporters/mini.failfast2.v12.log index 5c9445793..763b0e57b 100644 --- a/test-tap/reporters/mini.failfast2.log +++ b/test-tap/reporters/mini.failfast2.v12.log @@ -20,6 +20,8 @@ Test failed via `t.fail()` + › 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. diff --git a/test-tap/reporters/mini.failfast2.v13.log b/test-tap/reporters/mini.failfast2.v13.log new file mode 100644 index 000000000..763b0e57b --- /dev/null +++ b/test-tap/reporters/mini.failfast2.v13.log @@ -0,0 +1,29 @@ +[?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 + 1 test failed + + a › fails + + a.js:3 + + 2: +  3: test('fails', t => t.fail());  + 4: test('passes', t => t.pass()); + + Test failed via `t.fail()` + + › 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. + +---tty-stream-chunk-separator diff --git a/test-tap/reporters/mini.js b/test-tap/reporters/mini.js index 7bdae33bf..68ea0e1da 100644 --- a/test-tap/reporters/mini.js +++ b/test-tap/reporters/mini.js @@ -15,11 +15,11 @@ const MiniReporter = require('../../lib/reporters/mini'); const run = (type, sanitizers = []) => t => { t.plan(1); - const logFile = path.join(__dirname, `mini.${type.toLowerCase()}.log`); + const logFile = path.join(__dirname, `mini.${type.toLowerCase()}.${process.version.split('.')[0]}.log`); const tty = new TTYStream({ columns: 200, - sanitizers: [...sanitizers, report.sanitizers.cwd, report.sanitizers.experimentalWarning, report.sanitizers.posix, report.sanitizers.traces, report.sanitizers.version] + sanitizers: [...sanitizers, report.sanitizers.cwd, report.sanitizers.experimentalWarning, report.sanitizers.posix, report.sanitizers.version] }); const reporter = new MiniReporter({ projectDir: report.projectDir(type), diff --git a/test-tap/reporters/mini.only.log b/test-tap/reporters/mini.only.v10.log similarity index 100% rename from test-tap/reporters/mini.only.log rename to test-tap/reporters/mini.only.v10.log diff --git a/test-tap/reporters/mini.only.v12.log b/test-tap/reporters/mini.only.v12.log new file mode 100644 index 000000000..7bb4c83c2 --- /dev/null +++ b/test-tap/reporters/mini.only.v12.log @@ -0,0 +1,17 @@ +[?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.only.v13.log b/test-tap/reporters/mini.only.v13.log new file mode 100644 index 000000000..7bb4c83c2 --- /dev/null +++ b/test-tap/reporters/mini.only.v13.log @@ -0,0 +1,17 @@ +[?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 new file mode 100644 index 000000000..973f9a818 --- /dev/null +++ b/test-tap/reporters/mini.regular.v10.log @@ -0,0 +1,498 @@ +[?25l---tty-stream-chunk-separator + +---tty-stream-chunk-separator +* ---tty-stream-chunk-separator +---tty-stream-chunk-separator +* output-in-hook › passing test + + 1 passed---tty-stream-chunk-separator +---tty-stream-chunk-separator +* output-in-hook › failing test + + 1 passed + 1 test failed---tty-stream-chunk-separator +---tty-stream-chunk-separator +* slow › slow + + 2 passed + 1 test failed---tty-stream-chunk-separator +---tty-stream-chunk-separator +* test › passes + + 3 passed + 1 test failed + 1 skipped + 1 todo---tty-stream-chunk-separator +---tty-stream-chunk-separator +* test › fails + + 3 passed + 2 tests failed + 1 skipped + 1 todo---tty-stream-chunk-separator +---tty-stream-chunk-separator +* test › known failure + + 3 passed + 1 known failure + 2 tests failed + 1 skipped + 1 todo---tty-stream-chunk-separator +---tty-stream-chunk-separator +* test › no longer failing + + 3 passed + 1 known failure + 3 tests failed + 1 skipped + 1 todo---tty-stream-chunk-separator +---tty-stream-chunk-separator +* test › logs + + 3 passed + 1 known failure + 4 tests failed + 1 skipped + 1 todo---tty-stream-chunk-separator +---tty-stream-chunk-separator +* test › formatted + + 3 passed + 1 known failure + 5 tests failed + 1 skipped + 1 todo---tty-stream-chunk-separator +---tty-stream-chunk-separator +* test › power-assert + + 3 passed + 1 known failure + 6 tests failed + 1 skipped + 1 todo---tty-stream-chunk-separator +---tty-stream-chunk-separator +* test › bad throws + + 3 passed + 1 known failure + 7 tests failed + 1 skipped + 1 todo---tty-stream-chunk-separator +---tty-stream-chunk-separator +* test › bad notThrows + + 3 passed + 1 known failure + 8 tests failed + 1 skipped + 1 todo---tty-stream-chunk-separator +---tty-stream-chunk-separator +* test › implementation throws non-error + + 3 passed + 1 known failure + 9 tests failed + 1 skipped + 1 todo---tty-stream-chunk-separator +---tty-stream-chunk-separator +* traces-in-t-throws › throws + + 3 passed + 1 known failure + 10 tests failed + 1 skipped + 1 todo---tty-stream-chunk-separator +---tty-stream-chunk-separator +* traces-in-t-throws › notThrows + + 3 passed + 1 known failure + 11 tests failed + 1 skipped + 1 todo---tty-stream-chunk-separator +---tty-stream-chunk-separator +* traces-in-t-throws › notThrowsAsync + + 3 passed + 1 known failure + 12 tests failed + 1 skipped + 1 todo---tty-stream-chunk-separator +---tty-stream-chunk-separator +* traces-in-t-throws › throwsAsync + + 3 passed + 1 known failure + 13 tests failed + 1 skipped + 1 todo---tty-stream-chunk-separator +---tty-stream-chunk-separator +* traces-in-t-throws › throwsAsync different error + + 3 passed + 1 known failure + 14 tests failed + 1 skipped + 1 todo---tty-stream-chunk-separator +---tty-stream-chunk-separator +* uncaught-exception › passes + + 4 passed + 1 known failure + 14 tests failed + 1 skipped + 1 todo---tty-stream-chunk-separator +---tty-stream-chunk-separator +* unhandled-rejection › passes + + 5 passed + 1 known failure + 14 tests failed + 1 skipped + 1 todo---tty-stream-chunk-separator +---tty-stream-chunk-separator +* unhandled-rejection › unhandled non-error rejection + + 6 passed + 1 known failure + 14 tests failed + 1 skipped + 1 todo---tty-stream-chunk-separator +---tty-stream-chunk-separator +[?25h + ✖ No tests found in bad-test-chain.js + + 14 tests failed + 1 known failure + 1 test skipped + 1 test todo + 2 unhandled rejections + 2 uncaught exceptions + + test › known failure + + 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) + › process._tickCallback (internal/process/next_tick.js:68:7) + + + + 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) + › process._tickCallback (internal/process/next_tick.js:68:7) + + + + test › no longer failing + + + Error: Test was expected to fail, but succeeded, you should stop marking the test as failing + + › process._tickCallback (internal/process/next_tick.js:68:7) + + + + 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) + › process._tickCallback (internal/process/next_tick.js:68:7) + + + + 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) + › process._tickCallback (internal/process/next_tick.js:68:7) + + + + 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) + › process._tickCallback (internal/process/next_tick.js:68:7) + + + + 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) + › process._tickCallback (internal/process/next_tick.js:68:7) + + + + 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) + › process._tickCallback (internal/process/next_tick.js:68:7) + + + + test › implementation throws non-error + + + Error thrown in test: + + null + + › process._tickCallback (internal/process/next_tick.js:68:7) + + + + 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 (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) + › process._tickCallback (internal/process/next_tick.js:68:7) + + + + 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 (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) + › process._tickCallback (internal/process/next_tick.js:68:7) + + + + 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) + › process._tickCallback (internal/process/next_tick.js:68:7) + + + + 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) + › process._tickCallback (internal/process/next_tick.js:68:7) + + + + 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) + › process._tickCallback (internal/process/next_tick.js:68:7) + + + + 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: setTimeout(() => { +  5: throw new Error('Can’t catch me'); + 6: }); + + Error: Can’t catch me + + › Timeout.setTimeout (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) + › process._tickCallback (internal/process/next_tick.js:68:7) + + + + Unhandled rejection in unhandled-rejection.js + + null + +---tty-stream-chunk-separator diff --git a/test-tap/reporters/mini.regular.log b/test-tap/reporters/mini.regular.v12.log similarity index 85% rename from test-tap/reporters/mini.regular.log rename to test-tap/reporters/mini.regular.v12.log index 2ef59f32b..833953736 100644 --- a/test-tap/reporters/mini.regular.log +++ b/test-tap/reporters/mini.regular.v12.log @@ -181,6 +181,8 @@ Test failed via `t.fail()` + › test-tap/fixture/report/regular/output-in-hook.js:34:4 + test › fails @@ -193,6 +195,8 @@ Test failed via `t.fail()` + › test-tap/fixture/report/regular/test.js:9:22 + test › no longer failing @@ -200,6 +204,8 @@ Error: Test was expected to fail, but succeeded, you should stop marking the test as failing + ›  + test › logs @@ -214,6 +220,8 @@ Test failed via `t.fail()` + › test-tap/fixture/report/regular/test.js:18:4 + test › formatted @@ -229,6 +237,8 @@ - 'foo' + 'bar' + › test-tap/fixture/report/regular/test.js:22:4 + test › power-assert @@ -246,6 +256,8 @@ foo => '' + › test-tap/fixture/report/regular/test.js:27:4 + test › bad throws @@ -272,8 +284,8 @@ https://github.com/avajs/ava/blob/v1.0.0-beta.5.1/docs/03-assertions.md#throwsfn-expected-message - test.js:32:9 - test.js:35:11 + › fn (test-tap/fixture/report/regular/test.js:32:9) + › test-tap/fixture/report/regular/test.js:35:11 @@ -301,8 +313,8 @@ https://github.com/avajs/ava/blob/v1.0.0-beta.5.1/docs/03-assertions.md#throwsfn-expected-message - test.js:40:9 - test.js:43:14 + › fn (test-tap/fixture/report/regular/test.js:40:9) + › test-tap/fixture/report/regular/test.js:43:14 @@ -313,6 +325,8 @@ null + ›  + traces-in-t-throws › throws @@ -333,9 +347,9 @@ Function TypeError {} - traces-in-t-throws.js:4:8 - traces-in-t-throws.js:12:17 - traces-in-t-throws.js:12:4 + › throwError (test-tap/fixture/report/regular/traces-in-t-throws.js:4:8) + › t.throws.instanceOf (test-tap/fixture/report/regular/traces-in-t-throws.js:12:17) + › test-tap/fixture/report/regular/traces-in-t-throws.js:12:4 @@ -353,9 +367,9 @@ message: 'uh-oh', } - traces-in-t-throws.js:4:8 - traces-in-t-throws.js:16:20 - traces-in-t-throws.js:16:4 + › throwError (test-tap/fixture/report/regular/traces-in-t-throws.js:4:8) + › test-tap/fixture/report/regular/traces-in-t-throws.js:16:20 + › test-tap/fixture/report/regular/traces-in-t-throws.js:16:4 @@ -373,9 +387,9 @@ message: 'uh-oh', } - traces-in-t-throws.js:4:8 - traces-in-t-throws.js:20:25 - traces-in-t-throws.js:20:4 + › throwError (test-tap/fixture/report/regular/traces-in-t-throws.js:4:8) + › test-tap/fixture/report/regular/traces-in-t-throws.js:20:25 + › test-tap/fixture/report/regular/traces-in-t-throws.js:20:4 @@ -393,9 +407,9 @@ message: 'uh-oh', } - traces-in-t-throws.js:4:8 - traces-in-t-throws.js:24:22 - traces-in-t-throws.js:24:4 + › throwError (test-tap/fixture/report/regular/traces-in-t-throws.js:4:8) + › t.throwsAsync.instanceOf (test-tap/fixture/report/regular/traces-in-t-throws.js:24:22) + › test-tap/fixture/report/regular/traces-in-t-throws.js:24:4 @@ -417,8 +431,8 @@ Function TypeError {} - traces-in-t-throws.js:8:24 - traces-in-t-throws.js:28:11 + › returnRejectedPromise (test-tap/fixture/report/regular/traces-in-t-throws.js:8:24) + › test-tap/fixture/report/regular/traces-in-t-throws.js:28:11 @@ -432,6 +446,8 @@ 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 @@ -444,6 +460,10 @@ Error: Can’t catch me + › Timeout._onTimeout (test-tap/fixture/report/regular/uncaught-exception.js:5:9) + › listOnTimeout (internal/timers.js:549:17) + › processTimers (internal/timers.js:492:7) + Unhandled rejection in unhandled-rejection.js @@ -456,6 +476,8 @@ Error: Can’t catch me + › passes (test-tap/fixture/report/regular/unhandled-rejection.js:4:17) + Unhandled rejection in unhandled-rejection.js diff --git a/test-tap/reporters/mini.regular.v13.log b/test-tap/reporters/mini.regular.v13.log new file mode 100644 index 000000000..833953736 --- /dev/null +++ b/test-tap/reporters/mini.regular.v13.log @@ -0,0 +1,487 @@ +[?25l---tty-stream-chunk-separator + +---tty-stream-chunk-separator +* ---tty-stream-chunk-separator +---tty-stream-chunk-separator +* output-in-hook › passing test + + 1 passed---tty-stream-chunk-separator +---tty-stream-chunk-separator +* output-in-hook › failing test + + 1 passed + 1 test failed---tty-stream-chunk-separator +---tty-stream-chunk-separator +* slow › slow + + 2 passed + 1 test failed---tty-stream-chunk-separator +---tty-stream-chunk-separator +* test › passes + + 3 passed + 1 test failed + 1 skipped + 1 todo---tty-stream-chunk-separator +---tty-stream-chunk-separator +* test › fails + + 3 passed + 2 tests failed + 1 skipped + 1 todo---tty-stream-chunk-separator +---tty-stream-chunk-separator +* test › known failure + + 3 passed + 1 known failure + 2 tests failed + 1 skipped + 1 todo---tty-stream-chunk-separator +---tty-stream-chunk-separator +* test › no longer failing + + 3 passed + 1 known failure + 3 tests failed + 1 skipped + 1 todo---tty-stream-chunk-separator +---tty-stream-chunk-separator +* test › logs + + 3 passed + 1 known failure + 4 tests failed + 1 skipped + 1 todo---tty-stream-chunk-separator +---tty-stream-chunk-separator +* test › formatted + + 3 passed + 1 known failure + 5 tests failed + 1 skipped + 1 todo---tty-stream-chunk-separator +---tty-stream-chunk-separator +* test › power-assert + + 3 passed + 1 known failure + 6 tests failed + 1 skipped + 1 todo---tty-stream-chunk-separator +---tty-stream-chunk-separator +* test › bad throws + + 3 passed + 1 known failure + 7 tests failed + 1 skipped + 1 todo---tty-stream-chunk-separator +---tty-stream-chunk-separator +* test › bad notThrows + + 3 passed + 1 known failure + 8 tests failed + 1 skipped + 1 todo---tty-stream-chunk-separator +---tty-stream-chunk-separator +* test › implementation throws non-error + + 3 passed + 1 known failure + 9 tests failed + 1 skipped + 1 todo---tty-stream-chunk-separator +---tty-stream-chunk-separator +* traces-in-t-throws › throws + + 3 passed + 1 known failure + 10 tests failed + 1 skipped + 1 todo---tty-stream-chunk-separator +---tty-stream-chunk-separator +* traces-in-t-throws › notThrows + + 3 passed + 1 known failure + 11 tests failed + 1 skipped + 1 todo---tty-stream-chunk-separator +---tty-stream-chunk-separator +* traces-in-t-throws › notThrowsAsync + + 3 passed + 1 known failure + 12 tests failed + 1 skipped + 1 todo---tty-stream-chunk-separator +---tty-stream-chunk-separator +* traces-in-t-throws › throwsAsync + + 3 passed + 1 known failure + 13 tests failed + 1 skipped + 1 todo---tty-stream-chunk-separator +---tty-stream-chunk-separator +* traces-in-t-throws › throwsAsync different error + + 3 passed + 1 known failure + 14 tests failed + 1 skipped + 1 todo---tty-stream-chunk-separator +---tty-stream-chunk-separator +* uncaught-exception › passes + + 4 passed + 1 known failure + 14 tests failed + 1 skipped + 1 todo---tty-stream-chunk-separator +---tty-stream-chunk-separator +* unhandled-rejection › passes + + 5 passed + 1 known failure + 14 tests failed + 1 skipped + 1 todo---tty-stream-chunk-separator +---tty-stream-chunk-separator +* unhandled-rejection › unhandled non-error rejection + + 6 passed + 1 known failure + 14 tests failed + 1 skipped + 1 todo---tty-stream-chunk-separator +---tty-stream-chunk-separator +[?25h + ✖ No tests found in bad-test-chain.js + + 14 tests failed + 1 known failure + 1 test skipped + 1 test todo + 2 unhandled rejections + 2 uncaught exceptions + + test › known failure + + output-in-hook › failing test + + output-in-hook.js:34 + + 33: test('failing test', t => { +  34: t.fail();  + 35: }); + + Test failed via `t.fail()` + + › 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()` + + › 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()` + + › 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' + + › 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 + => '' + + › 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) + › 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) + › 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.instanceOf (test-tap/fixture/report/regular/traces-in-t-throws.js:12:17) + › 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) + › test-tap/fixture/report/regular/traces-in-t-throws.js:16:20 + › 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) + › test-tap/fixture/report/regular/traces-in-t-throws.js:20:25 + › 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.instanceOf (test-tap/fixture/report/regular/traces-in-t-throws.js:24:22) + › 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) + › 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: setTimeout(() => { +  5: throw new Error('Can’t catch me'); + 6: }); + + Error: Can’t catch me + + › Timeout._onTimeout (test-tap/fixture/report/regular/uncaught-exception.js:5:9) + › listOnTimeout (internal/timers.js:549:17) + › processTimers (internal/timers.js:492:7) + + + + 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 + +---tty-stream-chunk-separator diff --git a/test-tap/reporters/mini.watch.log b/test-tap/reporters/mini.watch.v10.log similarity index 100% rename from test-tap/reporters/mini.watch.log rename to test-tap/reporters/mini.watch.v10.log diff --git a/test-tap/reporters/mini.watch.v12.log b/test-tap/reporters/mini.watch.v12.log new file mode 100644 index 000000000..1f6d8ef7c --- /dev/null +++ b/test-tap/reporters/mini.watch.v12.log @@ -0,0 +1,48 @@ +[?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/mini.watch.v13.log b/test-tap/reporters/mini.watch.v13.log new file mode 100644 index 000000000..1f6d8ef7c --- /dev/null +++ b/test-tap/reporters/mini.watch.v13.log @@ -0,0 +1,48 @@ +[?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/readme.md b/test-tap/reporters/readme.md new file mode 100644 index 000000000..485a32395 --- /dev/null +++ b/test-tap/reporters/readme.md @@ -0,0 +1,13 @@ +# Rebuilding reporter log files + +`*.log` files contain reporter output. There are separate files for every supported Node.js version. + +To update a specific set of files you can run: + +```console +UPDATE_REPORTER_LOG=1 npx tap -j3 test-tap/reporters/{mini,verbose,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). + +Make sure to commit any new files, and of course changed ones. diff --git a/test-tap/reporters/tap.edgecases.log b/test-tap/reporters/tap.edgecases.v10.log similarity index 85% rename from test-tap/reporters/tap.edgecases.log rename to test-tap/reporters/tap.edgecases.v10.log index 27b8c048d..838ef9d3a 100644 --- a/test-tap/reporters/tap.edgecases.log +++ b/test-tap/reporters/tap.edgecases.v10.log @@ -8,7 +8,9 @@ not ok 2 - TypeError: test is not a function --- name: TypeError message: test is not a function - at: 'import-and-use-test-member.js:3:1' + at: >- + 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 @@ -22,7 +24,7 @@ not ok 5 - Error: throws --- name: Error message: throws - at: 'throws.js:1:7' + at: 'Object. (test-tap/fixture/report/edgecases/throws.js:1:7)' ... ---tty-stream-chunk-separator # throws.js exited with a non-zero exit code: 1 diff --git a/test-tap/reporters/tap.edgecases.v12.log b/test-tap/reporters/tap.edgecases.v12.log new file mode 100644 index 000000000..838ef9d3a --- /dev/null +++ b/test-tap/reporters/tap.edgecases.v12.log @@ -0,0 +1,39 @@ +TAP version 13 +---tty-stream-chunk-separator +# No tests found in ava-import-no-test-declaration.js +not ok 1 - No tests found in ava-import-no-test-declaration.js +---tty-stream-chunk-separator +# TypeError: test is not a function +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 +# import-and-use-test-member.js exited with a non-zero exit code: 1 +not ok 3 - 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 +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 +# Error: throws +not ok 5 - Error: throws + --- + name: Error + message: throws + at: 'Object. (test-tap/fixture/report/edgecases/throws.js:1:7)' + ... +---tty-stream-chunk-separator +# throws.js exited with a non-zero exit code: 1 +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.edgecases.v13.log b/test-tap/reporters/tap.edgecases.v13.log new file mode 100644 index 000000000..838ef9d3a --- /dev/null +++ b/test-tap/reporters/tap.edgecases.v13.log @@ -0,0 +1,39 @@ +TAP version 13 +---tty-stream-chunk-separator +# No tests found in ava-import-no-test-declaration.js +not ok 1 - No tests found in ava-import-no-test-declaration.js +---tty-stream-chunk-separator +# TypeError: test is not a function +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 +# import-and-use-test-member.js exited with a non-zero exit code: 1 +not ok 3 - 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 +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 +# Error: throws +not ok 5 - Error: throws + --- + name: Error + message: throws + at: 'Object. (test-tap/fixture/report/edgecases/throws.js:1:7)' + ... +---tty-stream-chunk-separator +# throws.js exited with a non-zero exit code: 1 +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 new file mode 100644 index 000000000..e20ac8df8 --- /dev/null +++ b/test-tap/reporters/tap.failfast.v10.log @@ -0,0 +1,20 @@ +TAP version 13 +---tty-stream-chunk-separator +# a › fails +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) + process._tickCallback (internal/process/next_tick.js:68:7) + ... +---tty-stream-chunk-separator + +1..1 +# tests 1 +# pass 0 +# fail 1 + +---tty-stream-chunk-separator diff --git a/test-tap/reporters/tap.failfast.log b/test-tap/reporters/tap.failfast.v12.log similarity index 84% rename from test-tap/reporters/tap.failfast.log rename to test-tap/reporters/tap.failfast.v12.log index e512af4d6..a38a7d8ef 100644 --- a/test-tap/reporters/tap.failfast.log +++ b/test-tap/reporters/tap.failfast.v12.log @@ -6,7 +6,7 @@ not ok 1 - a › fails name: AssertionError message: Test failed via `t.fail()` assertion: fail - at: 'a.js:3:22' + at: 'test-tap/fixture/report/failfast/a.js:3:22' ... ---tty-stream-chunk-separator diff --git a/test-tap/reporters/tap.failfast.v13.log b/test-tap/reporters/tap.failfast.v13.log new file mode 100644 index 000000000..a38a7d8ef --- /dev/null +++ b/test-tap/reporters/tap.failfast.v13.log @@ -0,0 +1,18 @@ +TAP version 13 +---tty-stream-chunk-separator +# a › fails +not ok 1 - a › fails + --- + name: AssertionError + message: Test failed via `t.fail()` + assertion: fail + at: '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 new file mode 100644 index 000000000..3cf71cff0 --- /dev/null +++ b/test-tap/reporters/tap.failfast2.v10.log @@ -0,0 +1,22 @@ +TAP version 13 +---tty-stream-chunk-separator +# a › fails +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) + process._tickCallback (internal/process/next_tick.js:68:7) + ... +---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.failfast2.log b/test-tap/reporters/tap.failfast2.v12.log similarity index 86% rename from test-tap/reporters/tap.failfast2.log rename to test-tap/reporters/tap.failfast2.v12.log index 78aebbd1a..4300019d7 100644 --- a/test-tap/reporters/tap.failfast2.log +++ b/test-tap/reporters/tap.failfast2.v12.log @@ -6,7 +6,7 @@ not ok 1 - a › fails name: AssertionError message: Test failed via `t.fail()` assertion: fail - at: 'a.js:3:22' + at: 'test-tap/fixture/report/failfast2/a.js:3:22' ... ---tty-stream-chunk-separator # 1 test remaining in a.js diff --git a/test-tap/reporters/tap.failfast2.v13.log b/test-tap/reporters/tap.failfast2.v13.log new file mode 100644 index 000000000..4300019d7 --- /dev/null +++ b/test-tap/reporters/tap.failfast2.v13.log @@ -0,0 +1,20 @@ +TAP version 13 +---tty-stream-chunk-separator +# a › fails +not ok 1 - a › fails + --- + name: AssertionError + message: Test failed via `t.fail()` + assertion: fail + at: '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.js b/test-tap/reporters/tap.js index 23d552443..4290bc361 100644 --- a/test-tap/reporters/tap.js +++ b/test-tap/reporters/tap.js @@ -10,11 +10,11 @@ const TapReporter = require('../../lib/reporters/tap'); const run = (type, sanitizers = []) => t => { t.plan(1); - const logFile = path.join(__dirname, `tap.${type.toLowerCase()}.log`); + const logFile = path.join(__dirname, `tap.${type.toLowerCase()}.${process.version.split('.')[0]}.log`); const tty = new TTYStream({ columns: 200, - sanitizers: [...sanitizers, report.sanitizers.cwd, report.sanitizers.experimentalWarning, report.sanitizers.posix, report.sanitizers.timeout, report.sanitizers.traces] + sanitizers: [...sanitizers, report.sanitizers.cwd, report.sanitizers.experimentalWarning, report.sanitizers.posix] }); const reporter = new TapReporter({ projectDir: report.projectDir(type), diff --git a/test-tap/reporters/tap.only.log b/test-tap/reporters/tap.only.v10.log similarity index 100% rename from test-tap/reporters/tap.only.log rename to test-tap/reporters/tap.only.v10.log diff --git a/test-tap/reporters/tap.only.v12.log b/test-tap/reporters/tap.only.v12.log new file mode 100644 index 000000000..4df4b8c60 --- /dev/null +++ b/test-tap/reporters/tap.only.v12.log @@ -0,0 +1,15 @@ +TAP version 13 +---tty-stream-chunk-separator +# a › only +ok 1 - a › only +---tty-stream-chunk-separator +# b › passes +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.only.v13.log b/test-tap/reporters/tap.only.v13.log new file mode 100644 index 000000000..4df4b8c60 --- /dev/null +++ b/test-tap/reporters/tap.only.v13.log @@ -0,0 +1,15 @@ +TAP version 13 +---tty-stream-chunk-separator +# a › only +ok 1 - a › only +---tty-stream-chunk-separator +# b › passes +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 new file mode 100644 index 000000000..2f5e85438 --- /dev/null +++ b/test-tap/reporters/tap.regular.v10.log @@ -0,0 +1,311 @@ +TAP version 13 +---tty-stream-chunk-separator +# TypeError: test.serial.test is not a function +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 +# bad-test-chain.js exited with a non-zero exit code: 1 +not ok 2 - bad-test-chain.js exited with a non-zero exit code: 1 +---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 +# output-in-hook › passing test +ok 3 - output-in-hook › passing test +---tty-stream-chunk-separator +# output-in-hook › failing test +not ok 4 - 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) + process._tickCallback (internal/process/next_tick.js:68:7) + ... +---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 +# slow › slow +ok 5 - slow › slow +---tty-stream-chunk-separator +# test › skip +ok 6 - test › skip # SKIP +---tty-stream-chunk-separator +# test › todo +not ok 7 - test › todo # TODO +---tty-stream-chunk-separator +# test › passes +ok 8 - test › passes +---tty-stream-chunk-separator +# test › fails +not ok 9 - test › fails + --- + name: AssertionError + message: Test failed via `t.fail()` + assertion: fail + at: |- + t (test-tap/fixture/report/regular/test.js:9:22) + process._tickCallback (internal/process/next_tick.js:68:7) + ... +---tty-stream-chunk-separator +# test › known failure +ok 10 - test › known failure +---tty-stream-chunk-separator +# test › no longer failing +not ok 11 - test › no longer failing + --- + name: Error + message: >- + Test was expected to fail, but succeeded, you should stop marking the test as + failing + at: 'process._tickCallback (internal/process/next_tick.js:68:7)' + ... +---tty-stream-chunk-separator +# test › logs +not ok 12 - 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) + process._tickCallback (internal/process/next_tick.js:68:7) + ... +---tty-stream-chunk-separator +# test › formatted +not ok 13 - test › formatted + --- + name: AssertionError + assertion: deepEqual + values: + 'Difference:': |- + - 'foo' + + 'bar' + at: |- + t (test-tap/fixture/report/regular/test.js:22:4) + process._tickCallback (internal/process/next_tick.js:68:7) + ... +---tty-stream-chunk-separator +# test › power-assert +not ok 14 - test › power-assert + --- + name: AssertionError + assertion: assert + operator: '!!' + values: + 'Value is not truthy:': '''''' + at: |- + t (test-tap/fixture/report/regular/test.js:27:4) + process._tickCallback (internal/process/next_tick.js:68:7) + ... +---tty-stream-chunk-separator +# test › bad throws +not ok 15 - 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) + process._tickCallback (internal/process/next_tick.js:68:7) + ... +---tty-stream-chunk-separator +# test › bad notThrows +not ok 16 - 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) + process._tickCallback (internal/process/next_tick.js:68:7) + ... +---tty-stream-chunk-separator +# test › implementation throws non-error +not ok 17 - test › implementation throws non-error + --- + name: AssertionError + message: Error thrown in test + values: + 'Error thrown in test:': 'null' + at: 'process._tickCallback (internal/process/next_tick.js:68:7)' + ... +---tty-stream-chunk-separator +# traces-in-t-throws › throws +not ok 18 - 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 (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) + process._tickCallback (internal/process/next_tick.js:68:7) + ... +---tty-stream-chunk-separator +# traces-in-t-throws › notThrows +not ok 19 - 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 (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) + process._tickCallback (internal/process/next_tick.js:68:7) + ... +---tty-stream-chunk-separator +# traces-in-t-throws › notThrowsAsync +not ok 20 - 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) + process._tickCallback (internal/process/next_tick.js:68:7) + ... +---tty-stream-chunk-separator +# traces-in-t-throws › throwsAsync +not ok 21 - 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) + process._tickCallback (internal/process/next_tick.js:68:7) + ... +---tty-stream-chunk-separator +# traces-in-t-throws › throwsAsync different error +not ok 22 - 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) + + process._tickCallback (internal/process/next_tick.js:68:7) + ... +---tty-stream-chunk-separator +# uncaught-exception › passes +ok 23 - uncaught-exception › passes +---tty-stream-chunk-separator +# Error: Can’t catch me +not ok 24 - Error: Can’t catch me + --- + name: Error + message: Can’t catch me + at: 'Timeout.setTimeout (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 +not ok 25 - uncaught-exception.js exited with a non-zero exit code: 1 +---tty-stream-chunk-separator +# unhandled-rejection › passes +ok 26 - unhandled-rejection › passes +---tty-stream-chunk-separator +# unhandled-rejection › unhandled non-error rejection +ok 27 - unhandled-rejection › unhandled non-error rejection +---tty-stream-chunk-separator +# Error: Can’t catch me +not ok 28 - Error: Can’t catch me + --- + name: Error + message: Can’t catch me + at: |- + passes (test-tap/fixture/report/regular/unhandled-rejection.js:4:17) + process._tickCallback (internal/process/next_tick.js:68:7) + ... +---tty-stream-chunk-separator +# unhandled-rejection +not ok 29 - unhandled-rejection + --- + message: Non-error object + formatted: 'null' + ... +---tty-stream-chunk-separator + +1..23 +# tests 22 +# pass 7 +# skip 1 +# fail 21 + +---tty-stream-chunk-separator diff --git a/test-tap/reporters/tap.regular.log b/test-tap/reporters/tap.regular.v12.log similarity index 78% rename from test-tap/reporters/tap.regular.log rename to test-tap/reporters/tap.regular.v12.log index a08ed0d60..6d5c17e7f 100644 --- a/test-tap/reporters/tap.regular.log +++ b/test-tap/reporters/tap.regular.v12.log @@ -5,7 +5,7 @@ not ok 1 - TypeError: test.serial.test is not a function --- name: TypeError message: test.serial.test is not a function - at: 'bad-test-chain.js:3:13' + at: '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 @@ -34,7 +34,7 @@ not ok 4 - output-in-hook › failing test name: AssertionError message: Test failed via `t.fail()` assertion: fail - at: 'output-in-hook.js:34:4' + at: 'test-tap/fixture/report/regular/output-in-hook.js:34:4' ... ---tty-stream-chunk-separator # output-in-hook › afterEach hook for passing test @@ -71,7 +71,7 @@ not ok 9 - test › fails name: AssertionError message: Test failed via `t.fail()` assertion: fail - at: 'test.js:9:22' + at: 'test-tap/fixture/report/regular/test.js:9:22' ... ---tty-stream-chunk-separator # test › known failure @@ -84,6 +84,7 @@ not ok 11 - test › no longer failing message: >- Test was expected to fail, but succeeded, you should stop marking the test as failing + at: '' ... ---tty-stream-chunk-separator # test › logs @@ -94,7 +95,7 @@ not ok 12 - test › logs name: AssertionError message: Test failed via `t.fail()` assertion: fail - at: 'test.js:18:4' + at: 'test-tap/fixture/report/regular/test.js:18:4' ... ---tty-stream-chunk-separator # test › formatted @@ -106,7 +107,7 @@ not ok 13 - test › formatted 'Difference:': |- - 'foo' + 'bar' - at: 'test.js:22:4' + at: 'test-tap/fixture/report/regular/test.js:22:4' ... ---tty-stream-chunk-separator # test › power-assert @@ -117,7 +118,7 @@ not ok 14 - test › power-assert operator: '!!' values: 'Value is not truthy:': '''''' - at: 'test.js:27:4' + at: 'test-tap/fixture/report/regular/test.js:27:4' ... ---tty-stream-chunk-separator # test › bad throws @@ -132,8 +133,8 @@ not ok 15 - test › bad throws message: 'err', } at: |- - test.js:32:9 - test.js:35:11 + fn (test-tap/fixture/report/regular/test.js:32:9) + test-tap/fixture/report/regular/test.js:35:11 ... ---tty-stream-chunk-separator # test › bad notThrows @@ -148,8 +149,8 @@ not ok 16 - test › bad notThrows message: 'err', } at: |- - test.js:40:9 - test.js:43:14 + fn (test-tap/fixture/report/regular/test.js:40:9) + test-tap/fixture/report/regular/test.js:43:14 ... ---tty-stream-chunk-separator # test › implementation throws non-error @@ -159,6 +160,7 @@ not ok 17 - test › implementation throws non-error message: Error thrown in test values: 'Error thrown in test:': 'null' + at: '' ... ---tty-stream-chunk-separator # traces-in-t-throws › throws @@ -172,10 +174,13 @@ not ok 18 - traces-in-t-throws › throws message: 'uh-oh', } 'Expected instance of:': 'Function TypeError {}' - at: |- - traces-in-t-throws.js:4:8 - traces-in-t-throws.js:12:17 - traces-in-t-throws.js:12:4 + at: >- + throwError (test-tap/fixture/report/regular/traces-in-t-throws.js:4:8) + + t.throws.instanceOf + (test-tap/fixture/report/regular/traces-in-t-throws.js:12:17) + + test-tap/fixture/report/regular/traces-in-t-throws.js:12:4 ... ---tty-stream-chunk-separator # traces-in-t-throws › notThrows @@ -189,9 +194,9 @@ not ok 19 - traces-in-t-throws › notThrows message: 'uh-oh', } at: |- - traces-in-t-throws.js:4:8 - traces-in-t-throws.js:16:20 - traces-in-t-throws.js:16:4 + throwError (test-tap/fixture/report/regular/traces-in-t-throws.js:4:8) + test-tap/fixture/report/regular/traces-in-t-throws.js:16:20 + test-tap/fixture/report/regular/traces-in-t-throws.js:16:4 ... ---tty-stream-chunk-separator # traces-in-t-throws › notThrowsAsync @@ -205,9 +210,9 @@ not ok 20 - traces-in-t-throws › notThrowsAsync message: 'uh-oh', } at: |- - traces-in-t-throws.js:4:8 - traces-in-t-throws.js:20:25 - traces-in-t-throws.js:20:4 + throwError (test-tap/fixture/report/regular/traces-in-t-throws.js:4:8) + test-tap/fixture/report/regular/traces-in-t-throws.js:20:25 + test-tap/fixture/report/regular/traces-in-t-throws.js:20:4 ... ---tty-stream-chunk-separator # traces-in-t-throws › throwsAsync @@ -220,10 +225,13 @@ not ok 21 - traces-in-t-throws › throwsAsync Error { message: 'uh-oh', } - at: |- - traces-in-t-throws.js:4:8 - traces-in-t-throws.js:24:22 - traces-in-t-throws.js:24:4 + at: >- + throwError (test-tap/fixture/report/regular/traces-in-t-throws.js:4:8) + + t.throwsAsync.instanceOf + (test-tap/fixture/report/regular/traces-in-t-throws.js:24:22) + + test-tap/fixture/report/regular/traces-in-t-throws.js:24:4 ... ---tty-stream-chunk-separator # traces-in-t-throws › throwsAsync different error @@ -237,9 +245,11 @@ not ok 22 - traces-in-t-throws › throwsAsync different erro message: 'uh-oh', } 'Expected instance of:': 'Function TypeError {}' - at: |- - traces-in-t-throws.js:8:24 - traces-in-t-throws.js:28:11 + at: >- + returnRejectedPromise + (test-tap/fixture/report/regular/traces-in-t-throws.js:8:24) + + test-tap/fixture/report/regular/traces-in-t-throws.js:28:11 ... ---tty-stream-chunk-separator # uncaught-exception › passes @@ -250,7 +260,10 @@ not ok 24 - Error: Can’t catch me --- name: Error message: Can’t catch me - at: 'uncaught-exception.js:5:9' + at: |- + Timeout._onTimeout (test-tap/fixture/report/regular/uncaught-exception.js:5:9) + listOnTimeout (internal/timers.js:549:17) + processTimers (internal/timers.js:492:7) ... ---tty-stream-chunk-separator # uncaught-exception.js exited with a non-zero exit code: 1 @@ -267,7 +280,7 @@ not ok 28 - Error: Can’t catch me --- name: Error message: Can’t catch me - at: 'unhandled-rejection.js:4:17' + at: 'passes (test-tap/fixture/report/regular/unhandled-rejection.js:4:17)' ... ---tty-stream-chunk-separator # unhandled-rejection diff --git a/test-tap/reporters/tap.regular.v13.log b/test-tap/reporters/tap.regular.v13.log new file mode 100644 index 000000000..6d5c17e7f --- /dev/null +++ b/test-tap/reporters/tap.regular.v13.log @@ -0,0 +1,300 @@ +TAP version 13 +---tty-stream-chunk-separator +# TypeError: test.serial.test is not a function +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 +# bad-test-chain.js exited with a non-zero exit code: 1 +not ok 2 - bad-test-chain.js exited with a non-zero exit code: 1 +---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 +# output-in-hook › passing test +ok 3 - output-in-hook › passing test +---tty-stream-chunk-separator +# output-in-hook › failing test +not ok 4 - output-in-hook › failing test + --- + name: AssertionError + message: Test failed via `t.fail()` + assertion: fail + at: '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 +# slow › slow +ok 5 - slow › slow +---tty-stream-chunk-separator +# test › skip +ok 6 - test › skip # SKIP +---tty-stream-chunk-separator +# test › todo +not ok 7 - test › todo # TODO +---tty-stream-chunk-separator +# test › passes +ok 8 - test › passes +---tty-stream-chunk-separator +# test › fails +not ok 9 - test › fails + --- + name: AssertionError + message: Test failed via `t.fail()` + assertion: fail + at: 'test-tap/fixture/report/regular/test.js:9:22' + ... +---tty-stream-chunk-separator +# test › known failure +ok 10 - test › known failure +---tty-stream-chunk-separator +# test › no longer failing +not ok 11 - 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 +# test › logs +not ok 12 - test › logs + * hello + * world + --- + name: AssertionError + message: Test failed via `t.fail()` + assertion: fail + at: 'test-tap/fixture/report/regular/test.js:18:4' + ... +---tty-stream-chunk-separator +# test › formatted +not ok 13 - test › formatted + --- + name: AssertionError + assertion: deepEqual + values: + 'Difference:': |- + - 'foo' + + 'bar' + at: 'test-tap/fixture/report/regular/test.js:22:4' + ... +---tty-stream-chunk-separator +# test › power-assert +not ok 14 - test › power-assert + --- + name: AssertionError + assertion: assert + operator: '!!' + values: + 'Value is not truthy:': '''''' + at: 'test-tap/fixture/report/regular/test.js:27:4' + ... +---tty-stream-chunk-separator +# test › bad throws +not ok 15 - 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) + test-tap/fixture/report/regular/test.js:35:11 + ... +---tty-stream-chunk-separator +# test › bad notThrows +not ok 16 - 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) + test-tap/fixture/report/regular/test.js:43:14 + ... +---tty-stream-chunk-separator +# test › implementation throws non-error +not ok 17 - test › implementation throws non-error + --- + name: AssertionError + message: Error thrown in test + values: + 'Error thrown in test:': 'null' + at: '' + ... +---tty-stream-chunk-separator +# traces-in-t-throws › throws +not ok 18 - 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.instanceOf + (test-tap/fixture/report/regular/traces-in-t-throws.js:12:17) + + test-tap/fixture/report/regular/traces-in-t-throws.js:12:4 + ... +---tty-stream-chunk-separator +# traces-in-t-throws › notThrows +not ok 19 - 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) + test-tap/fixture/report/regular/traces-in-t-throws.js:16:20 + test-tap/fixture/report/regular/traces-in-t-throws.js:16:4 + ... +---tty-stream-chunk-separator +# traces-in-t-throws › notThrowsAsync +not ok 20 - 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) + test-tap/fixture/report/regular/traces-in-t-throws.js:20:25 + test-tap/fixture/report/regular/traces-in-t-throws.js:20:4 + ... +---tty-stream-chunk-separator +# traces-in-t-throws › throwsAsync +not ok 21 - 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.instanceOf + (test-tap/fixture/report/regular/traces-in-t-throws.js:24:22) + + test-tap/fixture/report/regular/traces-in-t-throws.js:24:4 + ... +---tty-stream-chunk-separator +# traces-in-t-throws › throwsAsync different error +not ok 22 - 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) + + test-tap/fixture/report/regular/traces-in-t-throws.js:28:11 + ... +---tty-stream-chunk-separator +# uncaught-exception › passes +ok 23 - uncaught-exception › passes +---tty-stream-chunk-separator +# Error: Can’t catch me +not ok 24 - Error: Can’t catch me + --- + name: Error + message: Can’t catch me + at: |- + Timeout._onTimeout (test-tap/fixture/report/regular/uncaught-exception.js:5:9) + listOnTimeout (internal/timers.js:549:17) + processTimers (internal/timers.js:492:7) + ... +---tty-stream-chunk-separator +# uncaught-exception.js exited with a non-zero exit code: 1 +not ok 25 - uncaught-exception.js exited with a non-zero exit code: 1 +---tty-stream-chunk-separator +# unhandled-rejection › passes +ok 26 - unhandled-rejection › passes +---tty-stream-chunk-separator +# unhandled-rejection › unhandled non-error rejection +ok 27 - unhandled-rejection › unhandled non-error rejection +---tty-stream-chunk-separator +# Error: Can’t catch me +not ok 28 - 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 +# unhandled-rejection +not ok 29 - unhandled-rejection + --- + message: Non-error object + formatted: 'null' + ... +---tty-stream-chunk-separator + +1..23 +# tests 22 +# pass 7 +# skip 1 +# fail 21 + +---tty-stream-chunk-separator diff --git a/test-tap/reporters/verbose.edgecases.log b/test-tap/reporters/verbose.edgecases.v10.log similarity index 84% rename from test-tap/reporters/verbose.edgecases.log rename to test-tap/reporters/verbose.edgecases.v10.log index 9d654c505..c46f3ad2e 100644 --- a/test-tap/reporters/verbose.edgecases.log +++ b/test-tap/reporters/verbose.edgecases.v10.log @@ -13,6 +13,8 @@ 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 @@ -28,6 +30,8 @@ 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 diff --git a/test-tap/reporters/verbose.edgecases.v12.log b/test-tap/reporters/verbose.edgecases.v12.log new file mode 100644 index 000000000..c46f3ad2e --- /dev/null +++ b/test-tap/reporters/verbose.edgecases.v12.log @@ -0,0 +1,41 @@ + +---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 + + 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.edgecases.v13.log b/test-tap/reporters/verbose.edgecases.v13.log new file mode 100644 index 000000000..c46f3ad2e --- /dev/null +++ b/test-tap/reporters/verbose.edgecases.v13.log @@ -0,0 +1,41 @@ + +---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 + + 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 new file mode 100644 index 000000000..b486f10f3 --- /dev/null +++ b/test-tap/reporters/verbose.failfast.v10.log @@ -0,0 +1,25 @@ + +---tty-stream-chunk-separator + ✖ a › fails Test failed via `t.fail()` +---tty-stream-chunk-separator + + 1 test failed + + 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) + › process._tickCallback (internal/process/next_tick.js:68:7) + + + + `--fail-fast` is on. 1 test file was skipped. + +---tty-stream-chunk-separator diff --git a/test-tap/reporters/verbose.failfast.log b/test-tap/reporters/verbose.failfast.v12.log similarity index 89% rename from test-tap/reporters/verbose.failfast.log rename to test-tap/reporters/verbose.failfast.v12.log index 9f640ba2c..a20425d12 100644 --- a/test-tap/reporters/verbose.failfast.log +++ b/test-tap/reporters/verbose.failfast.v12.log @@ -15,6 +15,8 @@ Test failed via `t.fail()` + › test-tap/fixture/report/failfast/a.js:3:22 + `--fail-fast` is on. 1 test file was skipped. diff --git a/test-tap/reporters/verbose.failfast.v13.log b/test-tap/reporters/verbose.failfast.v13.log new file mode 100644 index 000000000..a20425d12 --- /dev/null +++ b/test-tap/reporters/verbose.failfast.v13.log @@ -0,0 +1,24 @@ + +---tty-stream-chunk-separator + ✖ a › fails Test failed via `t.fail()` +---tty-stream-chunk-separator + + 1 test failed + + a › fails + + a.js:3 + + 2: +  3: test('fails', t => t.fail()); + 4: + + Test failed via `t.fail()` + + › test-tap/fixture/report/failfast/a.js:3:22 + + + + `--fail-fast` is on. 1 test file was skipped. + +---tty-stream-chunk-separator diff --git a/test-tap/reporters/verbose.failfast2.v10.log b/test-tap/reporters/verbose.failfast2.v10.log new file mode 100644 index 000000000..44a7443b7 --- /dev/null +++ b/test-tap/reporters/verbose.failfast2.v10.log @@ -0,0 +1,25 @@ + +---tty-stream-chunk-separator + ✖ a › fails Test failed via `t.fail()` +---tty-stream-chunk-separator + + 1 test failed + + 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) + › process._tickCallback (internal/process/next_tick.js:68:7) + + + + `--fail-fast` is on. At least 1 test was skipped, as well as 1 test file. + +---tty-stream-chunk-separator diff --git a/test-tap/reporters/verbose.failfast2.log b/test-tap/reporters/verbose.failfast2.v12.log similarity index 89% rename from test-tap/reporters/verbose.failfast2.log rename to test-tap/reporters/verbose.failfast2.v12.log index 23cd8b8b8..f91d476d3 100644 --- a/test-tap/reporters/verbose.failfast2.log +++ b/test-tap/reporters/verbose.failfast2.v12.log @@ -15,6 +15,8 @@ Test failed via `t.fail()` + › 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. diff --git a/test-tap/reporters/verbose.failfast2.v13.log b/test-tap/reporters/verbose.failfast2.v13.log new file mode 100644 index 000000000..f91d476d3 --- /dev/null +++ b/test-tap/reporters/verbose.failfast2.v13.log @@ -0,0 +1,24 @@ + +---tty-stream-chunk-separator + ✖ a › fails Test failed via `t.fail()` +---tty-stream-chunk-separator + + 1 test failed + + a › fails + + a.js:3 + + 2: +  3: test('fails', t => t.fail());  + 4: test('passes', t => t.pass()); + + Test failed via `t.fail()` + + › 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. + +---tty-stream-chunk-separator diff --git a/test-tap/reporters/verbose.js b/test-tap/reporters/verbose.js index 0839b63e9..167f68410 100644 --- a/test-tap/reporters/verbose.js +++ b/test-tap/reporters/verbose.js @@ -9,11 +9,11 @@ const VerboseReporter = require('../../lib/reporters/verbose'); const run = (type, sanitizers = []) => t => { t.plan(1); - const logFile = path.join(__dirname, `verbose.${type.toLowerCase()}.log`); + const logFile = path.join(__dirname, `verbose.${type.toLowerCase()}.${process.version.split('.')[0]}.log`); const tty = new TTYStream({ columns: 200, - sanitizers: [...sanitizers, report.sanitizers.cwd, report.sanitizers.experimentalWarning, report.sanitizers.posix, report.sanitizers.slow, report.sanitizers.traces, report.sanitizers.version] + sanitizers: [...sanitizers, report.sanitizers.cwd, report.sanitizers.experimentalWarning, report.sanitizers.posix, report.sanitizers.slow, report.sanitizers.version] }); const reporter = new VerboseReporter({ projectDir: report.projectDir(type), diff --git a/test-tap/reporters/verbose.only.log b/test-tap/reporters/verbose.only.v10.log similarity index 100% rename from test-tap/reporters/verbose.only.log rename to test-tap/reporters/verbose.only.v10.log diff --git a/test-tap/reporters/verbose.only.v12.log b/test-tap/reporters/verbose.only.v12.log new file mode 100644 index 000000000..67c5e210e --- /dev/null +++ b/test-tap/reporters/verbose.only.v12.log @@ -0,0 +1,10 @@ + +---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.only.v13.log b/test-tap/reporters/verbose.only.v13.log new file mode 100644 index 000000000..67c5e210e --- /dev/null +++ b/test-tap/reporters/verbose.only.v13.log @@ -0,0 +1,10 @@ + +---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 new file mode 100644 index 000000000..5b19aef56 --- /dev/null +++ b/test-tap/reporters/verbose.regular.v10.log @@ -0,0 +1,408 @@ + +---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 + 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 + ✔ slow › slow (000ms) +---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: setTimeout(() => { +  5: throw new Error('Can’t catch me'); + 6: }); + + Error: Can’t catch me + + › Timeout.setTimeout (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) + › process._tickCallback (internal/process/next_tick.js:68:7) + +---tty-stream-chunk-separator + Unhandled rejection in unhandled-rejection.js + + null + +---tty-stream-chunk-separator + + 14 tests failed + 1 known failure + 1 test skipped + 1 test todo + 2 unhandled rejections + 2 uncaught exceptions + + test › known failure + + 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) + › process._tickCallback (internal/process/next_tick.js:68:7) + + + + 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) + › process._tickCallback (internal/process/next_tick.js:68:7) + + + + test › no longer failing + + + Error: Test was expected to fail, but succeeded, you should stop marking the test as failing + + › process._tickCallback (internal/process/next_tick.js:68:7) + + + + 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) + › process._tickCallback (internal/process/next_tick.js:68:7) + + + + 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) + › process._tickCallback (internal/process/next_tick.js:68:7) + + + + 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) + › process._tickCallback (internal/process/next_tick.js:68:7) + + + + 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) + › process._tickCallback (internal/process/next_tick.js:68:7) + + + + 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) + › process._tickCallback (internal/process/next_tick.js:68:7) + + + + test › implementation throws non-error + + + Error thrown in test: + + null + + › process._tickCallback (internal/process/next_tick.js:68:7) + + + + 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 (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) + › process._tickCallback (internal/process/next_tick.js:68:7) + + + + 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 (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) + › process._tickCallback (internal/process/next_tick.js:68:7) + + + + 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) + › process._tickCallback (internal/process/next_tick.js:68:7) + + + + 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) + › process._tickCallback (internal/process/next_tick.js:68:7) + + + + 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) + › process._tickCallback (internal/process/next_tick.js:68:7) + +---tty-stream-chunk-separator diff --git a/test-tap/reporters/verbose.regular.log b/test-tap/reporters/verbose.regular.v12.log similarity index 83% rename from test-tap/reporters/verbose.regular.log rename to test-tap/reporters/verbose.regular.v12.log index 2d6bac075..2331d55ec 100644 --- a/test-tap/reporters/verbose.regular.log +++ b/test-tap/reporters/verbose.regular.v12.log @@ -10,6 +10,8 @@ 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 @@ -89,6 +91,10 @@ Error: Can’t catch me + › Timeout._onTimeout (test-tap/fixture/report/regular/uncaught-exception.js:5:9) + › listOnTimeout (internal/timers.js:549:17) + › processTimers (internal/timers.js:492:7) + ---tty-stream-chunk-separator ✖ uncaught-exception.js exited with a non-zero exit code: 1 ---tty-stream-chunk-separator @@ -107,6 +113,8 @@ 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 @@ -133,6 +141,8 @@ Test failed via `t.fail()` + › test-tap/fixture/report/regular/output-in-hook.js:34:4 + test › fails @@ -145,6 +155,8 @@ Test failed via `t.fail()` + › test-tap/fixture/report/regular/test.js:9:22 + test › no longer failing @@ -152,6 +164,8 @@ Error: Test was expected to fail, but succeeded, you should stop marking the test as failing + ›  + test › logs @@ -166,6 +180,8 @@ Test failed via `t.fail()` + › test-tap/fixture/report/regular/test.js:18:4 + test › formatted @@ -181,6 +197,8 @@ - 'foo' + 'bar' + › test-tap/fixture/report/regular/test.js:22:4 + test › power-assert @@ -198,6 +216,8 @@ foo => '' + › test-tap/fixture/report/regular/test.js:27:4 + test › bad throws @@ -224,8 +244,8 @@ https://github.com/avajs/ava/blob/v1.0.0-beta.5.1/docs/03-assertions.md#throwsfn-expected-message - test.js:32:9 - test.js:35:11 + › fn (test-tap/fixture/report/regular/test.js:32:9) + › test-tap/fixture/report/regular/test.js:35:11 @@ -253,8 +273,8 @@ https://github.com/avajs/ava/blob/v1.0.0-beta.5.1/docs/03-assertions.md#throwsfn-expected-message - test.js:40:9 - test.js:43:14 + › fn (test-tap/fixture/report/regular/test.js:40:9) + › test-tap/fixture/report/regular/test.js:43:14 @@ -265,6 +285,8 @@ null + ›  + traces-in-t-throws › throws @@ -285,9 +307,9 @@ Function TypeError {} - traces-in-t-throws.js:4:8 - traces-in-t-throws.js:12:17 - traces-in-t-throws.js:12:4 + › throwError (test-tap/fixture/report/regular/traces-in-t-throws.js:4:8) + › t.throws.instanceOf (test-tap/fixture/report/regular/traces-in-t-throws.js:12:17) + › test-tap/fixture/report/regular/traces-in-t-throws.js:12:4 @@ -305,9 +327,9 @@ message: 'uh-oh', } - traces-in-t-throws.js:4:8 - traces-in-t-throws.js:16:20 - traces-in-t-throws.js:16:4 + › throwError (test-tap/fixture/report/regular/traces-in-t-throws.js:4:8) + › test-tap/fixture/report/regular/traces-in-t-throws.js:16:20 + › test-tap/fixture/report/regular/traces-in-t-throws.js:16:4 @@ -325,9 +347,9 @@ message: 'uh-oh', } - traces-in-t-throws.js:4:8 - traces-in-t-throws.js:20:25 - traces-in-t-throws.js:20:4 + › throwError (test-tap/fixture/report/regular/traces-in-t-throws.js:4:8) + › test-tap/fixture/report/regular/traces-in-t-throws.js:20:25 + › test-tap/fixture/report/regular/traces-in-t-throws.js:20:4 @@ -345,9 +367,9 @@ message: 'uh-oh', } - traces-in-t-throws.js:4:8 - traces-in-t-throws.js:24:22 - traces-in-t-throws.js:24:4 + › throwError (test-tap/fixture/report/regular/traces-in-t-throws.js:4:8) + › t.throwsAsync.instanceOf (test-tap/fixture/report/regular/traces-in-t-throws.js:24:22) + › test-tap/fixture/report/regular/traces-in-t-throws.js:24:4 @@ -369,7 +391,7 @@ Function TypeError {} - traces-in-t-throws.js:8:24 - traces-in-t-throws.js:28:11 + › returnRejectedPromise (test-tap/fixture/report/regular/traces-in-t-throws.js:8:24) + › test-tap/fixture/report/regular/traces-in-t-throws.js:28:11 ---tty-stream-chunk-separator diff --git a/test-tap/reporters/verbose.regular.v13.log b/test-tap/reporters/verbose.regular.v13.log new file mode 100644 index 000000000..2331d55ec --- /dev/null +++ b/test-tap/reporters/verbose.regular.v13.log @@ -0,0 +1,397 @@ + +---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 + 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 + ✔ slow › slow (000ms) +---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: setTimeout(() => { +  5: throw new Error('Can’t catch me'); + 6: }); + + Error: Can’t catch me + + › Timeout._onTimeout (test-tap/fixture/report/regular/uncaught-exception.js:5:9) + › listOnTimeout (internal/timers.js:549:17) + › processTimers (internal/timers.js:492:7) + +---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 + + 14 tests failed + 1 known failure + 1 test skipped + 1 test todo + 2 unhandled rejections + 2 uncaught exceptions + + test › known failure + + output-in-hook › failing test + + output-in-hook.js:34 + + 33: test('failing test', t => { +  34: t.fail();  + 35: }); + + Test failed via `t.fail()` + + › 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()` + + › 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()` + + › 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' + + › 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 + => '' + + › 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) + › 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) + › 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.instanceOf (test-tap/fixture/report/regular/traces-in-t-throws.js:12:17) + › 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) + › test-tap/fixture/report/regular/traces-in-t-throws.js:16:20 + › 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) + › test-tap/fixture/report/regular/traces-in-t-throws.js:20:25 + › 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.instanceOf (test-tap/fixture/report/regular/traces-in-t-throws.js:24:22) + › 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) + › test-tap/fixture/report/regular/traces-in-t-throws.js:28:11 + +---tty-stream-chunk-separator diff --git a/test-tap/reporters/verbose.timeoutinmultiplefiles.log b/test-tap/reporters/verbose.timeoutinmultiplefiles.v10.log similarity index 100% rename from test-tap/reporters/verbose.timeoutinmultiplefiles.log rename to test-tap/reporters/verbose.timeoutinmultiplefiles.v10.log diff --git a/test-tap/reporters/verbose.timeoutinmultiplefiles.v12.log b/test-tap/reporters/verbose.timeoutinmultiplefiles.v12.log new file mode 100644 index 000000000..f23ce9614 --- /dev/null +++ b/test-tap/reporters/verbose.timeoutinmultiplefiles.v12.log @@ -0,0 +1,33 @@ + +---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.timeoutinmultiplefiles.v13.log b/test-tap/reporters/verbose.timeoutinmultiplefiles.v13.log new file mode 100644 index 000000000..f23ce9614 --- /dev/null +++ b/test-tap/reporters/verbose.timeoutinmultiplefiles.v13.log @@ -0,0 +1,33 @@ + +---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.log b/test-tap/reporters/verbose.timeoutinsinglefile.v10.log similarity index 100% rename from test-tap/reporters/verbose.timeoutinsinglefile.log rename to test-tap/reporters/verbose.timeoutinsinglefile.v10.log diff --git a/test-tap/reporters/verbose.timeoutinsinglefile.v12.log b/test-tap/reporters/verbose.timeoutinsinglefile.v12.log new file mode 100644 index 000000000..e7edb7d8d --- /dev/null +++ b/test-tap/reporters/verbose.timeoutinsinglefile.v12.log @@ -0,0 +1,19 @@ + +---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.timeoutinsinglefile.v13.log b/test-tap/reporters/verbose.timeoutinsinglefile.v13.log new file mode 100644 index 000000000..e7edb7d8d --- /dev/null +++ b/test-tap/reporters/verbose.timeoutinsinglefile.v13.log @@ -0,0 +1,19 @@ + +---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.log b/test-tap/reporters/verbose.timeoutwithmatch.v10.log similarity index 100% rename from test-tap/reporters/verbose.timeoutwithmatch.log rename to test-tap/reporters/verbose.timeoutwithmatch.v10.log diff --git a/test-tap/reporters/verbose.timeoutwithmatch.v12.log b/test-tap/reporters/verbose.timeoutwithmatch.v12.log new file mode 100644 index 000000000..2de6713d7 --- /dev/null +++ b/test-tap/reporters/verbose.timeoutwithmatch.v12.log @@ -0,0 +1,17 @@ + +---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.timeoutwithmatch.v13.log b/test-tap/reporters/verbose.timeoutwithmatch.v13.log new file mode 100644 index 000000000..2de6713d7 --- /dev/null +++ b/test-tap/reporters/verbose.timeoutwithmatch.v13.log @@ -0,0 +1,17 @@ + +---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.log b/test-tap/reporters/verbose.watch.v10.log similarity index 100% rename from test-tap/reporters/verbose.watch.log rename to test-tap/reporters/verbose.watch.v10.log diff --git a/test-tap/reporters/verbose.watch.v12.log b/test-tap/reporters/verbose.watch.v12.log new file mode 100644 index 000000000..31689cbd4 --- /dev/null +++ b/test-tap/reporters/verbose.watch.v12.log @@ -0,0 +1,29 @@ + +---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-tap/reporters/verbose.watch.v13.log b/test-tap/reporters/verbose.watch.v13.log new file mode 100644 index 000000000..31689cbd4 --- /dev/null +++ b/test-tap/reporters/verbose.watch.v13.log @@ -0,0 +1,29 @@ + +---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-tap/serialize-error.js b/test-tap/serialize-error.js index 724ca33fb..69f372470 100644 --- a/test-tap/serialize-error.js +++ b/test-tap/serialize-error.js @@ -2,46 +2,27 @@ require('../lib/chalk').set(); require('../lib/worker/options').set({}); -const fs = require('fs'); -const path = require('path'); -const sourceMapFixtures = require('source-map-fixtures'); -const sourceMapSupport = require('source-map-support'); -const tempWrite = require('temp-write'); -const tempy = require('tempy'); const {test} = require('tap'); const avaAssert = require('../lib/assert'); -const beautifyStack = require('../lib/beautify-stack'); const serializeError = require('../lib/serialize-error'); -const serialize = error => serializeError('Test', true, error); - -// Needed to test stack traces from source map fixtures. -sourceMapSupport.install({environment: 'node'}); - -const makeTemporaryDir = () => { - if (process.platform !== 'win32') { - return tempy.directory(); - } - - const dir = path.join(__dirname, '.tmpdir', `serialize-error.${process.pid}`); - fs.mkdirSync(dir, {recursive: true}); - return dir; -}; +const serialize = error => serializeError('Test', true, error, __filename); test('serialize standard props', t => { const error = new Error('Hello'); const serializedError = serialize(error); - t.is(Object.keys(serializedError).length, 8); + t.is(Object.keys(serializedError).length, 9); t.is(serializedError.avaAssertionError, false); t.is(serializedError.nonErrorObject, false); t.deepEqual(serializedError.object, {}); t.is(serializedError.name, 'Error'); - t.is(serializedError.stack, beautifyStack(error.stack)); + t.is(serializedError.stack, error.stack); t.is(serializedError.message, 'Hello'); t.is(serializedError.summary, 'Error: Hello'); - t.is(typeof serializedError.source.isDependency, 'boolean'); - t.is(typeof serializedError.source.isWithinProject, 'boolean'); + t.is(serializedError.shouldBeautifyStack, true); + t.is(serializedError.source.isWithinProject, true); + t.is(serializedError.source.isDependency, false); t.is(typeof serializedError.source.file, 'string'); t.is(typeof serializedError.source.line, 'number'); t.end(); @@ -61,77 +42,6 @@ test('source file is an absolute path', t => { t.end(); }); -test('source file is an absolute path, after source map correction', t => { - const fixture = sourceMapFixtures.mapFile('throws'); - try { - fixture.require().run(); - t.fail('Fixture should have thrown'); - } catch (error) { - const serializedError = serialize(error); - t.is(serializedError.source.file, fixture.sourceFile); - t.end(); - } -}); - -test('source file is an absolute path, after source map correction, even if already absolute', t => { - const fixture = sourceMapFixtures.mapFile('throws'); - const map = JSON.parse(fs.readFileSync(fixture.file + '.map')); - - const temporary = makeTemporaryDir(); - const sourceRoot = path.join(temporary, 'src'); - const expectedSourceFile = path.join(sourceRoot, map.file); - - const temporaryFile = path.join(temporary, path.basename(fixture.file)); - fs.writeFileSync(temporaryFile, fs.readFileSync(fixture.file)); - fs.writeFileSync(temporaryFile + '.map', JSON.stringify(Object.assign(map, {sourceRoot}), null, 2)); - - try { - require(temporaryFile).run(); - t.fail('Fixture should have thrown'); - } catch (error) { - const serializedError = serialize(error); - t.is(serializedError.source.file, expectedSourceFile); - t.end(); - } -}); - -test('determines whether source file is within the project', t => { - const file = tempWrite.sync('module.exports = () => { throw new Error("hello") }'); - try { - require(file)(); - t.fail('Should have thrown'); - } catch (error_) { - const serializedError = serialize(error_); - t.is(serializedError.source.file, file); - t.is(serializedError.source.isWithinProject, false); - } - - const error = new Error('Hello'); - const serializedError = serialize(error); - t.is(serializedError.source.file, __filename); - t.is(serializedError.source.isWithinProject, true); - t.end(); -}); - -test('determines whether source file, if within the project, is a dependency', t => { - const fixture = sourceMapFixtures.mapFile('throws'); - try { - fixture.require().run(); - t.fail('Fixture should have thrown'); - } catch (error_) { - const serializedError = serialize(error_); - t.is(serializedError.source.file, fixture.sourceFile); - t.is(serializedError.source.isWithinProject, true); - t.is(serializedError.source.isDependency, true); - } - - const error = new Error('Hello'); - const serializedError = serialize(error); - t.is(serializedError.source.file, __filename); - t.is(serializedError.source.isDependency, false); - t.end(); -}); - test('sets avaAssertionError to true if indeed an assertion error', t => { const error = new avaAssert.AssertionError({}); const serializedError = serialize(error); @@ -196,19 +106,3 @@ test('skips esm enhancement lines when finding the summary', t => { t.is(serializedError.summary, 'First line\nSecond line'); t.end(); }); - -test('works around esm’s insertion of file:// urls', t => { - const fixture = sourceMapFixtures.mapFile('throws'); - try { - fixture.require().run(); - t.fail('Fixture should have thrown'); - } catch (error) { - const expected = serialize(error); - Object.defineProperty(error, 'stack', { - value: error.stack.split('\n').map(line => line.replace('(/', '(file:///')).join('\n') - }); - const serializedError = serialize(error); - t.is(serializedError.source.file, expected.source.file); - t.end(); - } -});