From 3341df80785efbc6a12a94a38ca761e6ed3abd22 Mon Sep 17 00:00:00 2001 From: tymfear Date: Tue, 22 Dec 2020 18:40:06 +0200 Subject: [PATCH] Print diagnostic info according to TAP spec; maintenance (#4) * Print diagnostic info according to TAP spec TAP specification says that diagnostic info lines should start with `#`. * Support Node.js 10 * Update dependencies * Test using GitHub Actions Co-authored-by: Daudov, Tymur Co-authored-by: Mark Wubben --- .github/workflows/ci.yml | 22 + .travis.yml | 5 - index.js | 27 +- package.json | 28 +- scripts/check.js | 15 +- test/snapshots/test.js.md | 1227 +++++++++++++---------------------- test/snapshots/test.js.snap | Bin 3500 -> 3345 bytes test/test.js | 23 +- 8 files changed, 527 insertions(+), 820 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..5ba593b --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,22 @@ +name: Test +on: + push: + branches: + - master + pull_request: +jobs: + nodejs: + name: Node.js + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + node-version: [^10, ^12, ^14] + os: [ubuntu-latest, windows-latest] + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node-version }} + - run: npm install --no-audit + - run: npm test diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 7d69d74..0000000 --- a/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: node_js -node_js: - - '8' - - '6' - - '4' diff --git a/index.js b/index.js index 2ddde2a..d72da2a 100644 --- a/index.js +++ b/index.js @@ -1,29 +1,27 @@ 'use strict'; -const serializeErr = require('serialize-error'); +const {serializeError} = require('serialize-error'); const indentString = require('indent-string'); const stripAnsi = require('strip-ansi'); const arrify = require('arrify'); const yaml = require('js-yaml'); -const serializeError = err => { - const obj = serializeErr(err); - obj.at = obj.stack +const serializeErrorForTap = err => { + const object = serializeError(err); + object.at = object.stack .split('\n') .slice(1, 2) .map(line => line.replace(/at/, '').trim()) .shift(); - - delete obj.stack; - - return obj; + delete object.stack; + return object; }; exports.start = () => 'TAP version 13'; exports.test = (title, options) => { - const error = options.error; - let passed = options.passed; + const {error} = options; + let {passed} = options; let directive = ''; if (!error) { @@ -37,21 +35,20 @@ exports.test = (title, options) => { } const comment = arrify(options.comment) - .map(line => indentString(line, 4).replace(/^ {4}/, ' * ')) + .map(line => indentString(line, 4).replace(/^ {4}/gm, '# ')) .join('\n'); const output = [ - `# ${stripAnsi(title)}`, - `${passed ? 'ok' : 'not ok'} ${options.index} - ${title} ${directive}`.trim(), + `${passed ? 'ok' : 'not ok'} ${options.index} - ${stripAnsi(title)} ${directive}`.trim(), comment ]; if (error) { - const obj = error instanceof Error ? serializeError(error) : error; + const object = error instanceof Error ? serializeErrorForTap(error) : error; output.push([ ' ---', - indentString(yaml.safeDump(obj).trim(), 4), + indentString(yaml.safeDump(object).trim(), 4), ' ...' ].join('\n')); } diff --git a/package.json b/package.json index 1ff375a..cc307f9 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "url": "github.com/vadimdemedes" }, "engines": { - "node": ">=4" + "node": ">=10" }, "scripts": { "test": "xo && ava" @@ -24,28 +24,28 @@ "output" ], "dependencies": { - "arrify": "^1.0.1", - "indent-string": "^3.2.0", - "js-yaml": "^3.10.0", - "serialize-error": "^2.1.0", - "strip-ansi": "^4.0.0" + "arrify": "^2.0.1", + "indent-string": "^4.0.0", + "js-yaml": "^3.14.0", + "serialize-error": "^7.0.1", + "strip-ansi": "^6.0.0" }, "devDependencies": { - "ava": "^0.20.0", + "ava": "^3.14.0", "ctrlc-exit": "^1.0.0", - "execa": "^0.8.0", + "execa": "^5.0.0", "faucet": "^0.0.1", - "p-each-series": "^1.0.0", - "tap-dot": "^1.0.5", + "p-each-series": "^2.2.0", + "tap-dot": "^2.0.0", "tap-json": "^1.0.0", - "tap-min": "^1.2.2", + "tap-min": "^2.0.0", "tap-nyan": "^1.1.0", - "tap-out": "^2.0.0", + "tap-out": "^3.0.0", "tap-pessimist": "^1.0.1", - "tap-spec": "^4.1.1", + "tap-spec": "^5.0.0", "tap-summary": "^4.0.0", "wait-for-enter": "^1.0.0", - "xo": "^0.18.2" + "xo": "^0.36.1" }, "ava": { "serial": true diff --git a/scripts/check.js b/scripts/check.js index 97e5713..2c0a12b 100644 --- a/scripts/check.js +++ b/scripts/check.js @@ -4,21 +4,22 @@ const waitForEnter = require('wait-for-enter'); const eachSeries = require('p-each-series'); const ctrlcExit = require('ctrlc-exit'); const execa = require('execa'); +const path = require('path'); ctrlcExit(); -const exec = cmd => { - return execa.shell(cmd) - .catch(err => err) - .then(result => result.stdout); +const exec = async cmd => { + const {stdout} = await execa.command(cmd, {reject: false, shell: true}) + return stdout; }; -const fixtures = fs.readdirSync(`${__dirname}/../test/fixtures`); +const fixturePath = path.join(__dirname, '..', 'test', 'fixtures'); + +const fixtures = fs.readdirSync(fixturePath); const reporter = process.argv[2]; eachSeries(fixtures, async fixture => { - const fixturePath = `${__dirname}/../test/fixtures/${fixture}`; - const reporterPath = `${__dirname}/../node_modules/.bin/${reporter}`; + const reporterPath = path.join(__dirname, '..', 'node_modules', '.bin', reporter); const stdout = await exec(`node ${fixturePath} | ${reporterPath}`); console.log(fixture); console.log(stdout); diff --git a/test/snapshots/test.js.md b/test/snapshots/test.js.md index 6dbbc63..5b4f7a7 100644 --- a/test/snapshots/test.js.md +++ b/test/snapshots/test.js.md @@ -2,244 +2,146 @@ The actual snapshot is saved in `test.js.snap`. -Generated by [AVA](https://ava.li). +Generated by [AVA](https://avajs.dev). -## faucet - fail +## tap-spec - fail-without-error > Snapshot 1 - `␍ - # fail␊ - ␍ - not ok 1 fail␊ - ⨯ fail ---␊ + `␊ + ` + +## tap-spec - fail + +> Snapshot 1 + + `␊ + ✖ fail␊ + -------␊ actual: 1␊ expected: 2␊ - operator: ===␊ + operator: '==='␊ name: Error␊ message: error␊ at: 'fn (test.js:1:2)'␊ - ...␊ - ␊ - ␍ - # tests 1␊ - ␍ - tests 1␍ - # pass 0␊ - ␍ - pass 0␍ - # fail 1␊ - ⨯ fail 1` - -## faucet - fail-without-error - -> Snapshot 1 - - `␍ - # fail␊ - ␍ - not ok 1 fail␊ - ⨯ fail ␊ - ␍ - # tests 1␊ - ␍ - tests 1␍ - # pass 0␊ - ␍ - pass 0␍ - # fail 1␊ - ⨯ fail 1` + ␊ + ␊ + ` -## faucet - mixed +## tap-spec - mixed > Snapshot 1 - `␍ - # passing␊ - ␍ - ok 1 passing␍ - ✓ passing␍ - # fail␊ - ␍ - not ok 2 fail␊ - ⨯ fail ---␊ + ` ✔ passing␊ + ␊ + ✖ fail␊ + -------␊ actual: 1␊ expected: 2␊ - operator: ===␊ + operator: '==='␊ name: Error␊ message: error␊ at: 'fn (test.js:1:2)'␊ - ...␊ - ␍ - # pass with comment␊ - ␍ - ok 3 pass with comment␍ - ✓ pass with comment␍ - # pass with comment␊ - ␍ - ok 4 pass with comment␍ - ✓ pass with comment␍ - # skip␊ - ␍ - ok 5 skip # SKIP␍ - ✓ skip␍ - # todo␊ - ␍ - not ok 6 todo # TODO␊ - ⨯ todo ␊ - ␍ - # tests 5␊ - ␍ - tests 5␍ - # pass 3␊ - ␍ - pass 3␍ - # skip 1␊ - ␍ - ✓ skip 1␍ - # fail 2␊ - ⨯ fail 2` - -## faucet - pass - -> Snapshot 1 - - `␍ - # passing␊ - ␍ - ok 1 passing␍ - ✓ passing␍ - # tests 1␊ - ␍ - tests 1␍ - # pass 1␊ - ✓ pass 1` + ␊ + ✔ pass with comment␊ + ␊ + Hello␊ + ␊ + ✔ pass with comment␊ + ␊ + Hello␊ + ␊ + ␊ + Bonjour␊ + ␊ + - skip␊ + ␊ + ` -## faucet - pass-fail +## tap-spec - pass-fail > Snapshot 1 - `␍ - # passing␊ - ␍ - ok 1 passing␍ - ✓ passing␍ - # fail␊ - ␍ - not ok 2 fail␊ - ⨯ fail ---␊ + ` ✔ passing␊ + ␊ + ✖ fail␊ + -------␊ actual: 1␊ expected: 2␊ - operator: ===␊ + operator: '==='␊ name: Error␊ message: error␊ at: 'fn (test.js:1:2)'␊ - ...␊ - ␊ - ␍ - # tests 2␊ - ␍ - tests 2␍ - # pass 1␊ - ␍ - pass 1␍ - # fail 1␊ - ⨯ fail 1` + ␊ + ␊ + ` -## faucet - pass-with-multiple-comments +## tap-spec - pass-with-multiple-comments > Snapshot 1 - `␍ - # pass with comment␊ - ␍ - ok 1 pass with comment␍ - ✓ pass with comment␍ - # tests 1␊ - ␍ - tests 1␍ - # pass 1␊ - ✓ pass 1` + ` ✔ pass with comment␊ + ␊ + Hello␊ + ␊ + ␊ + Bonjour␊ + ␊ + ␊ + ␊ + total: 1␊ + passing: 1␊ + duration: ␊ + ␊ + ` -## faucet - pass-with-single-comment +## tap-spec - pass-with-single-comment > Snapshot 1 - `␍ - # pass with comment␊ - ␍ - ok 1 pass with comment␍ - ✓ pass with comment␍ - # tests 1␊ - ␍ - tests 1␍ - # pass 1␊ - ✓ pass 1` + ` ✔ pass with comment␊ + ␊ + Hello␊ + ␊ + ␊ + ␊ + total: 1␊ + passing: 1␊ + duration: ␊ + ␊ + ` -## faucet - skip +## tap-spec - pass > Snapshot 1 - `␍ - # skip␊ - ␍ - ok 1 skip # SKIP␍ - ✓ skip␍ - # tests 1␊ - ␍ - tests 1␍ - # pass 0␊ - ␍ - pass 0␍ - # skip 1␊ - ✓ skip 1` + ` ✔ passing␊ + ␊ + ␊ + total: 1␊ + passing: 1␊ + duration: ␊ + ␊ + ` -## faucet - todo +## tap-spec - skip > Snapshot 1 - `␍ - # todo␊ - ␍ - not ok 1 todo # TODO␊ - ⨯ todo ␊ - ␍ - # tests 0␊ - ␍ - tests 0␍ - # pass 0␊ - ␍ - pass 0␍ - # fail 1␊ - ⨯ fail 1` + ` - skip␊ + ␊ + ␊ + total: 1␊ + passing: 1␊ + duration: ␊ + ␊ + ` -## tap-dot - fail +## tap-spec - todo > Snapshot 1 `␊ - x ␊ - ␊ - ␊ - ---␊ - actual: 1␊ - expected: 2␊ - operator: ===␊ - name: Error␊ - message: error␊ - at: 'fn (test.js:1:2)'␊ - ...␊ - ␊ - ␊ - ␊ - 1 tests␊ - 0 passed␊ - 1 failed ␊ - ␊ - Failed Tests: There was 1 failure␊ - ␊ - x fail␊ - ␊ ` ## tap-dot - fail-without-error @@ -251,65 +153,39 @@ Generated by [AVA](https://ava.li). ␊ ␊ ---␊ - undefined␊ - ...␊ - ␊ - ␊ - ␊ - 1 tests␊ - 0 passed␊ - 1 failed ␊ - ␊ - Failed Tests: There was 1 failure␊ - ␊ - x fail␊ - ␊ - ` + undefined` -## tap-dot - mixed +## tap-dot - fail > Snapshot 1 `␊ - .x...x ␊ + x ␊ ␊ ␊ ---␊ actual: 1␊ expected: 2␊ - operator: ===␊ + operator: '==='␊ name: Error␊ message: error␊ - at: 'fn (test.js:1:2)'␊ - ...␊ - ---␊ - undefined␊ - ...␊ - ␊ - ␊ - ␊ - 6 tests␊ - 4 passed␊ - 2 failed ␊ - ␊ - Failed Tests: There were 2 failures␊ - ␊ - x fail␊ - x todo # TODO␊ - ␊ - ` + at: 'fn (test.js:1:2)'` -## tap-dot - pass +## tap-dot - mixed > Snapshot 1 `␊ - . ␊ + .x...x ␊ ␊ - 1 tests␊ - 1 passed␊ - ␊ - Pass!` + ␊ + ---␊ + actual: 1␊ + expected: 2␊ + operator: '==='␊ + name: Error␊ + message: error␊ + at: 'fn (test.js:1:2)'` ## tap-dot - pass-fail @@ -322,25 +198,24 @@ Generated by [AVA](https://ava.li). ---␊ actual: 1␊ expected: 2␊ - operator: ===␊ + operator: '==='␊ name: Error␊ message: error␊ - at: 'fn (test.js:1:2)'␊ - ...␊ - ␊ - ␊ + at: 'fn (test.js:1:2)'` + +## tap-dot - pass-with-multiple-comments + +> Snapshot 1 + + `␊ + . ␊ ␊ 2 tests␊ 1 passed␊ - 1 failed ␊ - ␊ - Failed Tests: There was 1 failure␊ - ␊ - x fail␊ ␊ - ` + Pass!` -## tap-dot - pass-with-multiple-comments +## tap-dot - pass-with-single-comment > Snapshot 1 @@ -352,14 +227,14 @@ Generated by [AVA](https://ava.li). ␊ Pass!` -## tap-dot - pass-with-single-comment +## tap-dot - pass > Snapshot 1 `␊ . ␊ ␊ - 1 tests␊ + 0 tests␊ 1 passed␊ ␊ Pass!` @@ -371,7 +246,7 @@ Generated by [AVA](https://ava.li). `␊ . ␊ ␊ - 1 tests␊ + 0 tests␊ 1 passed␊ ␊ Pass!` @@ -385,164 +260,9 @@ Generated by [AVA](https://ava.li). ␊ ␊ ---␊ - undefined␊ - ...␊ - ␊ - ␊ - ␊ - 1 tests␊ - 0 passed␊ - 1 failed ␊ - ␊ - Failed Tests: There was 1 failure␊ - ␊ - x todo # TODO␊ - ␊ - ` - -## tap-json - fail - -> Snapshot 1 - - '{"stats":{"asserts":1,"passes":0,"failures":1},"asserts":[{"number":1,"comment":"fail","name":"fail","ok":false,"extra":{"actual":"1","expected":"2","operator":"==="}}]}' - -## tap-json - fail-without-error - -> Snapshot 1 - - '{"stats":{"asserts":1,"passes":0,"failures":1},"asserts":[{"number":1,"comment":"fail","name":"fail","ok":false,"extra":{}}]}' - -## tap-json - mixed - -> Snapshot 1 - - '{"stats":{"asserts":6,"passes":4,"failures":2},"asserts":[{"number":1,"comment":"passing","name":"passing","ok":true,"extra":{}},{"number":2,"comment":"fail","name":"fail","ok":false,"extra":{"actual":"1","expected":"2","operator":"==="}},{"number":3,"comment":"pass with comment","name":"pass with comment","ok":true,"extra":{}},{"number":4,"comment":"pass with comment","name":"pass with comment","ok":true,"extra":{}},{"number":5,"comment":"skip","name":"skip # SKIP","ok":true,"extra":{}},{"number":6,"comment":"todo","name":"todo # TODO","ok":false,"extra":{}}]}' - -## tap-json - pass - -> Snapshot 1 - - '{"stats":{"asserts":1,"passes":1,"failures":0},"asserts":[{"number":1,"comment":"passing","name":"passing","ok":true,"extra":{}}]}' - -## tap-json - pass-fail - -> Snapshot 1 - - '{"stats":{"asserts":2,"passes":1,"failures":1},"asserts":[{"number":1,"comment":"passing","name":"passing","ok":true,"extra":{}},{"number":2,"comment":"fail","name":"fail","ok":false,"extra":{"actual":"1","expected":"2","operator":"==="}}]}' - -## tap-json - pass-with-multiple-comments - -> Snapshot 1 - - '{"stats":{"asserts":1,"passes":1,"failures":0},"asserts":[{"number":1,"comment":"pass with comment","name":"pass with comment","ok":true,"extra":{}}]}' - -## tap-json - pass-with-single-comment - -> Snapshot 1 - - '{"stats":{"asserts":1,"passes":1,"failures":0},"asserts":[{"number":1,"comment":"pass with comment","name":"pass with comment","ok":true,"extra":{}}]}' - -## tap-json - skip - -> Snapshot 1 - - '{"stats":{"asserts":1,"passes":1,"failures":0},"asserts":[{"number":1,"comment":"skip","name":"skip # SKIP","ok":true,"extra":{}}]}' - -## tap-json - todo - -> Snapshot 1 - - '{"stats":{"asserts":1,"passes":0,"failures":1},"asserts":[{"number":1,"comment":"todo","name":"todo # TODO","ok":false,"extra":{}}]}' - -## tap-min - fail - -> Snapshot 1 - - `␊ - fail␊ - operator: ===␊ - expected: 2␊ - actual: 1␊ - ␊ - 1 test complete ()␊ - ` - -## tap-min - fail-without-error - -> Snapshot 1 - - `␊ - fail␊ - ␊ - 1 test complete ()␊ - ` - -## tap-min - mixed - -> Snapshot 1 - - `␊ - fail␊ - operator: ===␊ - expected: 2␊ - actual: 1␊ - ␊ - todo␊ - ␊ - 6 tests complete ()␊ - ` - -## tap-min - pass - -> Snapshot 1 - - `␊ - 1 test complete ()` - -## tap-min - pass-fail - -> Snapshot 1 - - `␊ - fail␊ - operator: ===␊ - expected: 2␊ - actual: 1␊ - ␊ - 2 tests complete ()␊ - ` - -## tap-min - pass-with-multiple-comments - -> Snapshot 1 - - `␊ - 1 test complete ()` - -## tap-min - pass-with-single-comment - -> Snapshot 1 - - `␊ - 1 test complete ()` - -## tap-min - skip - -> Snapshot 1 - - `␊ - 1 test complete ()` + undefined` -## tap-min - todo - -> Snapshot 1 - - `␊ - todo␊ - ␊ - 1 test complete ()` - -## tap-nyan - fail +## tap-nyan - fail-without-error > Snapshot 1 @@ -564,10 +284,9 @@ Generated by [AVA](https://ava.li). ␊ Failed Tests: There was 1 failure␊ ␊ - ✗ # fail␊ - : fail` + ✗ : fail` -## tap-nyan - fail-without-error +## tap-nyan - fail > Snapshot 1 @@ -589,8 +308,7 @@ Generated by [AVA](https://ava.li). ␊ Failed Tests: There was 1 failure␊ ␊ - ✗ # fail␊ - : fail` + ✗ : fail` ## tap-nyan - mixed @@ -674,12 +392,11 @@ Generated by [AVA](https://ava.li). ␊ Failed Tests: There were 2 failures␊ ␊ - ✗ # fail␊ - : fail␊ - ✗ # todo␊ + ✗ : fail␊ + ✗ # Bonjour␊ : todo` -## tap-nyan - pass +## tap-nyan - pass-fail > Snapshot 1 @@ -695,13 +412,27 @@ Generated by [AVA](https://ava.li). _| /\\_/\\ ␊ ^|__( ^ .^) ␊  "" "" ␊ +  1␊ + 1␊ + 0␊ + ␊ + -_␊ + -_␊ + -_␊ + -_␊ + _,------,␊ + _| /\\_/\\ ␊ + ~|_( x .x) ␊ +  "" "" ␊ ␊ ␊ ␊ ␊ - Pass!` + Failed Tests: There was 1 failure␊ + ␊ + ✗ : fail` -## tap-nyan - pass-fail +## tap-nyan - pass-with-multiple-comments > Snapshot 1 @@ -717,28 +448,13 @@ Generated by [AVA](https://ava.li). _| /\\_/\\ ␊ ^|__( ^ .^) ␊  "" "" ␊ -  1␊ - 1␊ - 0␊ - ␊ - -_␊ - -_␊ - -_␊ - -_␊ - _,------,␊ - _| /\\_/\\ ␊ - ~|_( x .x) ␊ -  "" "" ␊ ␊ ␊ ␊ ␊ - Failed Tests: There was 1 failure␊ - ␊ - ✗ # fail␊ - : fail` + Pass!` -## tap-nyan - pass-with-multiple-comments +## tap-nyan - pass-with-single-comment > Snapshot 1 @@ -760,7 +476,7 @@ Generated by [AVA](https://ava.li). ␊ Pass!` -## tap-nyan - pass-with-single-comment +## tap-nyan - pass > Snapshot 1 @@ -826,360 +542,275 @@ Generated by [AVA](https://ava.li). ␊ Failed Tests: There was 1 failure␊ ␊ - ✗ # todo␊ - : todo` + ✗ : todo` -## tap-pessimist - fail +## tap-min - fail-without-error > Snapshot 1 - '' + `␊ + fail␊ + ␊ + 1 test complete ()` -## tap-pessimist - fail-without-error +## tap-min - fail > Snapshot 1 - '' + `␊ + fail␊ + at: 'fn (test.js:1:2)'␊ + operator: ===␊ + expected: 2␊ + actual: 1␊ + ␊ + undefined␊ + ␊ + ␊ + 1 test complete ()` -## tap-pessimist - mixed +## tap-min - mixed > Snapshot 1 - '' + `␊ + fail␊ + at: 'fn (test.js:1:2)'␊ + operator: ===␊ + expected: 2␊ + actual: 1␊ + ␊ + undefined␊ + ␊ + ␊ + todo␊ + ␊ + 6 tests complete ()` -## tap-pessimist - pass +## tap-min - pass-fail > Snapshot 1 - '' + `␊ + fail␊ + at: 'fn (test.js:1:2)'␊ + operator: ===␊ + expected: 2␊ + actual: 1␊ + ␊ + undefined␊ + ␊ + ␊ + 2 tests complete ()` -## tap-pessimist - pass-fail +## tap-min - pass-with-multiple-comments > Snapshot 1 - '' + `␊ + 1 test complete ()` -## tap-pessimist - pass-with-multiple-comments +## tap-min - pass-with-single-comment > Snapshot 1 - '' + `␊ + 1 test complete ()` -## tap-pessimist - pass-with-single-comment +## tap-min - pass > Snapshot 1 - '' + `␊ + 1 test complete ()` -## tap-pessimist - skip +## tap-min - skip > Snapshot 1 - '' + `␊ + 1 test complete ()` -## tap-pessimist - todo +## tap-min - todo > Snapshot 1 - '' + `␊ + todo␊ + ␊ + 1 test complete ()` -## tap-spec - fail +## faucet - fail-without-error > Snapshot 1 - `␊ - fail␊ - ␊ - ␊ - ✖ fail␊ - -------␊ - actual: 1␊ - expected: 2␊ - operator: ===␊ - name: Error␊ - message: error␊ - at: 'fn (test.js:1:2)'␊ - ␊ - ␊ - ␊ - ␊ - Failed Tests: There was 1 failure␊ - ␊ - fail␊ - ␊ - ✖ fail␊ - ␊ - ␊ - total: 1␊ - passing: 0␊ - failing: 1␊ - duration: ␊ - ␊ - ␊ - ` + `⨯ fail␊ + ␍ + # tests 1␊ + ␍ + tests 1␍ + # pass 0␊ + ␍ + pass 0␍ + # fail 1␊ + ⨯ fail 1` -## tap-spec - fail-without-error +## faucet - fail > Snapshot 1 - `␊ - fail␊ - ␊ - ␊ - ␊ - ␊ - Failed Tests: There was 1 failure␊ - ␊ - fail␊ - ␊ - ✖ fail␊ - ␊ - ␊ - total: 1␊ - passing: 0␊ - failing: 1␊ - duration: ␊ - ␊ - ` + `⨯ fail␊ + ␍ + # tests 1␊ + ␍ + tests 1␍ + # pass 0␊ + ␍ + pass 0␍ + # fail 1␊ + ⨯ fail 1` -## tap-spec - mixed +## faucet - mixed > Snapshot 1 - `␊ - passing␊ - ␊ - ✔ passing␊ - ␊ - fail␊ - ␊ - ␊ - ✖ fail␊ - -------␊ - actual: 1␊ - expected: 2␊ - operator: ===␊ - name: Error␊ - message: error␊ - at: 'fn (test.js:1:2)'␊ - ␊ - ␊ - pass with comment␊ - ␊ - ✔ pass with comment␊ - * Hello␊ - ␊ - pass with comment␊ - ␊ - ✔ pass with comment␊ - * Hello␊ - * Bonjour␊ - ␊ - skip␊ - ␊ - ✔ skip # SKIP␊ - ␊ - todo␊ - ␊ - ␊ - ␊ - ␊ - Failed Tests: There were 2 failures␊ - ␊ - fail␊ - ␊ - ✖ fail␊ - ␊ - ␊ - todo␊ - ␊ - ✖ todo # TODO␊ - ␊ - ␊ - total: 6␊ - passing: 4␊ - failing: 2␊ - duration: ␊ - ␊ - ␊ - ` + `✓ passing␊ + ⨯ fail␊ + ✓ pass with comment␊ + ␍ + # Hello␊ + ␍ + ok 4 pass with comment␍ + ✓ Hello␍ + # Hello␊ + ␍ + ✓ Hello␍ + # Bonjour␊ + ␍ + ok 5 skip # SKIP␍ + not ok 6 todo # TODO␊ + ⨯ Bonjour ␊ + ␍ + # tests 5␊ + ␍ + tests 5␍ + # pass 3␊ + ␍ + pass 3␍ + # skip 1␊ + ␍ + ✓ skip 1␍ + # fail 2␊ + ⨯ fail 2` -## tap-spec - pass +## faucet - pass-fail > Snapshot 1 - `␊ - passing␊ - ␊ - ✔ passing␊ - ␊ - ␊ - total: 1␊ - passing: 1␊ - duration: ␊ - ␊ - ` + `✓ passing␊ + ⨯ fail␊ + ␍ + # tests 2␊ + ␍ + tests 2␍ + # pass 1␊ + ␍ + pass 1␍ + # fail 1␊ + ⨯ fail 1` -## tap-spec - pass-fail +## faucet - pass-with-multiple-comments > Snapshot 1 - `␊ - passing␊ - ␊ - ✔ passing␊ - ␊ - fail␊ - ␊ - ␊ - ✖ fail␊ - -------␊ - actual: 1␊ - expected: 2␊ - operator: ===␊ - name: Error␊ - message: error␊ - at: 'fn (test.js:1:2)'␊ - ␊ - ␊ - ␊ - ␊ - Failed Tests: There was 1 failure␊ - ␊ - fail␊ - ␊ - ✖ fail␊ - ␊ - ␊ - total: 2␊ - passing: 1␊ - failing: 1␊ - duration: ␊ - ␊ - ␊ - ` + `✓ pass with comment␊ + ␍ + # Hello␊ + ␍ + ✓ Hello␍ + # Bonjour␊ + ␍ + ✓ Bonjour␍ + # tests 1␊ + ␍ + tests 1␍ + # pass 1␊ + ✓ pass 1` -## tap-spec - pass-with-multiple-comments +## faucet - pass-with-single-comment > Snapshot 1 - `␊ - pass with comment␊ - ␊ - ✔ pass with comment␊ - * Hello␊ - * Bonjour␊ - ␊ - ␊ - total: 1␊ - passing: 1␊ - duration: ␊ - ␊ - ` + `✓ pass with comment␊ + ␍ + # Hello␊ + ␍ + ✓ Hello␍ + # tests 1␊ + ␍ + tests 1␍ + # pass 1␊ + ✓ pass 1` -## tap-spec - pass-with-single-comment +## faucet - pass > Snapshot 1 - `␊ - pass with comment␊ - ␊ - ✔ pass with comment␊ - * Hello␊ - ␊ - ␊ - total: 1␊ - passing: 1␊ - duration: ␊ - ␊ - ` + `✓ passing␊ + ␍ + # tests 1␊ + ␍ + tests 1␍ + # pass 1␊ + ✓ pass 1` -## tap-spec - skip +## faucet - skip > Snapshot 1 - `␊ - skip␊ - ␊ - ✔ skip # SKIP␊ - ␊ - ␊ - total: 1␊ - passing: 1␊ - duration: ␊ - ␊ - ` + `✓ skip # SKIP␊ + ␍ + # tests 1␊ + ␍ + tests 1␍ + # pass 0␊ + ␍ + pass 0␍ + # skip 1␊ + ✓ skip 1` -## tap-spec - todo +## faucet - todo > Snapshot 1 - `␊ - todo␊ - ␊ - ␊ - ␊ - ␊ - Failed Tests: There was 1 failure␊ - ␊ - todo␊ - ␊ - ✖ todo # TODO␊ - ␊ - ␊ - total: 1␊ - passing: 0␊ - failing: 1␊ - duration: ␊ - ␊ - ` + `⨯ todo # TODO␊ + ␍ + # tests 0␊ + ␍ + tests 0␍ + # pass 0␊ + ␍ + pass 0␍ + # fail 1␊ + ⨯ fail 1` -## tap-summary - fail +## tap-summary - fail-without-error > Snapshot 1 `␊ # Tests␊ ␊ - # fail [pass: 0, fail: 0, duration: ]# fail [pass: 0, fail: 1, duration: ]✖ fail [pass: 0, fail: 1, duration: ]␊ - ␊ - # Summary␊ - ␊ - duration: ␊ - planned: 1␊ - assertions: 1␊ - pass: 0␊ - fail: 1␊ - ␊ - # Fails␊ - ␊ - ## fail␊ -  ✖ fail␊ -  actual: 1␊ - expected: 2␊ - operator: ===␊ - name: Error␊ - message: error␊ - at: 'fn (test.js:1:2)'␊ - ␊ - ` + # unnamed test [pass: 0, fail: 0, duration: ]# unnamed test [pass: 0, fail: 1, duration: ]✖ unnamed test [pass: 0, fail: 1, duration: ]` -## tap-summary - fail-without-error +## tap-summary - fail > Snapshot 1 `␊ # Tests␊ ␊ - # fail [pass: 0, fail: 0, duration: ]# fail [pass: 0, fail: 1, duration: ]✖ fail [pass: 0, fail: 1, duration: ]␊ - ␊ - # Summary␊ - ␊ - duration: ␊ - planned: 1␊ - assertions: 1␊ - pass: 0␊ - fail: 1` + # unnamed test [pass: 0, fail: 0, duration: ]# unnamed test [pass: 0, fail: 1, duration: ]✖ unnamed test [pass: 0, fail: 1, duration: ]` ## tap-summary - mixed @@ -1188,78 +819,49 @@ Generated by [AVA](https://ava.li). `␊ # Tests␊ ␊ - # passing [pass: 0, fail: 0, duration: ]# passing [pass: 1, fail: 0, duration: ]✔ passing [pass: 1, fail: 0, duration: ]␊ - # fail [pass: 0, fail: 0, duration: ]# fail [pass: 0, fail: 1, duration: ]✖ fail [pass: 0, fail: 1, duration: ]␊ - # pass with comment [pass: 0, fail: 0, duration: ]# pass with comment [pass: 1, fail: 0, duration: ]✔ pass with comment [pass: 1, fail: 0, duration: ]␊ - # pass with comment [pass: 0, fail: 0, duration: ]# pass with comment [pass: 1, fail: 0, duration: ]✔ pass with comment [pass: 1, fail: 0, duration: ]␊ - # skip [pass: 0, fail: 0, duration: ]# skip [pass: 1, fail: 0, duration: ]✔ skip [pass: 1, fail: 0, duration: ]␊ - # todo [pass: 0, fail: 0, duration: ]# todo [pass: 0, fail: 1, duration: ]✖ todo [pass: 0, fail: 1, duration: ]␊ - ␊ - # Summary␊ - ␊ - duration: ␊ - planned: 6␊ - assertions: 6␊ - pass: 4␊ - fail: 2` + # unnamed test [pass: 0, fail: 0, duration: ]# unnamed test [pass: 1, fail: 0, duration: ]# unnamed test [pass: 1, fail: 1, duration: ]# unnamed test [pass: 2, fail: 1, duration: ]✖ unnamed test [pass: 2, fail: 1, duration: ]␊ + # Hello [pass: 0, fail: 0, duration: ]# Hello [pass: 1, fail: 0, duration: ]✔ Hello [pass: 1, fail: 0, duration: ]␊ + # Hello [pass: 0, fail: 0, duration: ]✔ Hello [pass: 0, fail: 0, duration: ]␊ + # Bonjour [pass: 0, fail: 0, duration: ]# Bonjour [pass: 1, fail: 0, duration: ]# Bonjour [pass: 1, fail: 1, duration: ]✖ Bonjour [pass: 1, fail: 1, duration: ]` -## tap-summary - pass +## tap-summary - pass-fail > Snapshot 1 `␊ # Tests␊ ␊ - # passing [pass: 0, fail: 0, duration: ]# passing [pass: 1, fail: 0, duration: ]✔ passing [pass: 1, fail: 0, duration: ]␊ - ␊ - # Summary␊ - ␊ - duration: ␊ - planned: 1␊ - assertions: 1␊ - pass: 1␊ - fail: 0␊ - ` + # unnamed test [pass: 0, fail: 0, duration: ]# unnamed test [pass: 1, fail: 0, duration: ]# unnamed test [pass: 1, fail: 1, duration: ]✖ unnamed test [pass: 1, fail: 1, duration: ]` -## tap-summary - pass-fail +## tap-summary - pass-with-multiple-comments > Snapshot 1 `␊ # Tests␊ ␊ - # passing [pass: 0, fail: 0, duration: ]# passing [pass: 1, fail: 0, duration: ]✔ passing [pass: 1, fail: 0, duration: ]␊ - # fail [pass: 0, fail: 0, duration: ]# fail [pass: 0, fail: 1, duration: ]✖ fail [pass: 0, fail: 1, duration: ]␊ + # unnamed test [pass: 0, fail: 0, duration: ]# unnamed test [pass: 1, fail: 0, duration: ]✔ unnamed test [pass: 1, fail: 0, duration: ]␊ + # Hello [pass: 0, fail: 0, duration: ]✔ Hello [pass: 0, fail: 0, duration: ]␊ + # Bonjour [pass: 0, fail: 0, duration: ]✔ Bonjour [pass: 0, fail: 0, duration: ]␊ ␊ # Summary␊ ␊ duration: ␊ - planned: 2␊ - assertions: 2␊ + planned: 1␊ + assertions: 1␊ pass: 1␊ - fail: 1␊ - ␊ - # Fails␊ - ␊ - ## fail␊ -  ✖ fail␊ -  actual: 1␊ - expected: 2␊ - operator: ===␊ - name: Error␊ - message: error␊ - at: 'fn (test.js:1:2)'␊ - ␊ + fail: 0␊ ` -## tap-summary - pass-with-multiple-comments +## tap-summary - pass-with-single-comment > Snapshot 1 `␊ # Tests␊ ␊ - # pass with comment [pass: 0, fail: 0, duration: ]# pass with comment [pass: 1, fail: 0, duration: ]✔ pass with comment [pass: 1, fail: 0, duration: ]␊ + # unnamed test [pass: 0, fail: 0, duration: ]# unnamed test [pass: 1, fail: 0, duration: ]✔ unnamed test [pass: 1, fail: 0, duration: ]␊ + # Hello [pass: 0, fail: 0, duration: ]✔ Hello [pass: 0, fail: 0, duration: ]␊ ␊ # Summary␊ ␊ @@ -1268,22 +870,16 @@ Generated by [AVA](https://ava.li). assertions: 1␊ pass: 1␊ fail: 0␊ - ␊ - # Comments␊ - ␊ - ## pass with comment␊ - * Hello␊ - * Bonjour␊ ` -## tap-summary - pass-with-single-comment +## tap-summary - pass > Snapshot 1 `␊ # Tests␊ ␊ - # pass with comment [pass: 0, fail: 0, duration: ]# pass with comment [pass: 1, fail: 0, duration: ]✔ pass with comment [pass: 1, fail: 0, duration: ]␊ + # unnamed test [pass: 0, fail: 0, duration: ]# unnamed test [pass: 1, fail: 0, duration: ]✔ unnamed test [pass: 1, fail: 0, duration: ]␊ ␊ # Summary␊ ␊ @@ -1292,11 +888,6 @@ Generated by [AVA](https://ava.li). assertions: 1␊ pass: 1␊ fail: 0␊ - ␊ - # Comments␊ - ␊ - ## pass with comment␊ - * Hello␊ ` ## tap-summary - skip @@ -1306,7 +897,7 @@ Generated by [AVA](https://ava.li). `␊ # Tests␊ ␊ - # skip [pass: 0, fail: 0, duration: ]# skip [pass: 1, fail: 0, duration: ]✔ skip [pass: 1, fail: 0, duration: ]␊ + # unnamed test [pass: 0, fail: 0, duration: ]# unnamed test [pass: 1, fail: 0, duration: ]✔ unnamed test [pass: 1, fail: 0, duration: ]␊ ␊ # Summary␊ ␊ @@ -1324,12 +915,112 @@ Generated by [AVA](https://ava.li). `␊ # Tests␊ ␊ - # todo [pass: 0, fail: 0, duration: ]# todo [pass: 0, fail: 1, duration: ]✖ todo [pass: 0, fail: 1, duration: ]␊ - ␊ - # Summary␊ - ␊ - duration: ␊ - planned: 1␊ - assertions: 1␊ - pass: 0␊ - fail: 1` + # unnamed test [pass: 0, fail: 0, duration: ]# unnamed test [pass: 0, fail: 1, duration: ]✖ unnamed test [pass: 0, fail: 1, duration: ]` + +## tap-pessimist - fail-without-error + +> Snapshot 1 + + '' + +## tap-pessimist - fail + +> Snapshot 1 + + '' + +## tap-pessimist - mixed + +> Snapshot 1 + + '' + +## tap-pessimist - pass-fail + +> Snapshot 1 + + '' + +## tap-pessimist - pass-with-multiple-comments + +> Snapshot 1 + + '' + +## tap-pessimist - pass-with-single-comment + +> Snapshot 1 + + '' + +## tap-pessimist - pass + +> Snapshot 1 + + '' + +## tap-pessimist - skip + +> Snapshot 1 + + '' + +## tap-pessimist - todo + +> Snapshot 1 + + '' + +## tap-json - fail-without-error + +> Snapshot 1 + + '{"stats":{"asserts":1,"passes":0,"failures":1},"asserts":[{"number":1,"comment":null,"name":"fail","ok":false,"extra":{}}]}' + +## tap-json - fail + +> Snapshot 1 + + '{"stats":{"asserts":1,"passes":0,"failures":1},"asserts":[{"number":1,"comment":null,"name":"fail","ok":false,"extra":{"actual":"1","expected":"2","operator":"\'===\'"}}]}' + +## tap-json - mixed + +> Snapshot 1 + + '{"stats":{"asserts":6,"passes":4,"failures":2},"asserts":[{"number":1,"comment":null,"name":"passing","ok":true,"extra":{}},{"number":2,"comment":null,"name":"fail","ok":false,"extra":{"actual":"1","expected":"2","operator":"\'===\'"}},{"number":3,"comment":null,"name":"pass with comment","ok":true,"extra":{}},{"number":4,"comment":"Hello","name":"pass with comment","ok":true,"extra":{}},{"number":5,"comment":"Bonjour","name":"skip # SKIP","ok":true,"extra":{}},{"number":6,"comment":"Bonjour","name":"todo # TODO","ok":false,"extra":{}}]}' + +## tap-json - pass-fail + +> Snapshot 1 + + '{"stats":{"asserts":2,"passes":1,"failures":1},"asserts":[{"number":1,"comment":null,"name":"passing","ok":true,"extra":{}},{"number":2,"comment":null,"name":"fail","ok":false,"extra":{"actual":"1","expected":"2","operator":"\'===\'"}}]}' + +## tap-json - pass-with-multiple-comments + +> Snapshot 1 + + '{"stats":{"asserts":1,"passes":1,"failures":0},"asserts":[{"number":1,"comment":null,"name":"pass with comment","ok":true,"extra":{}}]}' + +## tap-json - pass-with-single-comment + +> Snapshot 1 + + '{"stats":{"asserts":1,"passes":1,"failures":0},"asserts":[{"number":1,"comment":null,"name":"pass with comment","ok":true,"extra":{}}]}' + +## tap-json - pass + +> Snapshot 1 + + '{"stats":{"asserts":1,"passes":1,"failures":0},"asserts":[{"number":1,"comment":null,"name":"passing","ok":true,"extra":{}}]}' + +## tap-json - skip + +> Snapshot 1 + + '{"stats":{"asserts":1,"passes":1,"failures":0},"asserts":[{"number":1,"comment":null,"name":"skip # SKIP","ok":true,"extra":{}}]}' + +## tap-json - todo + +> Snapshot 1 + + '{"stats":{"asserts":1,"passes":0,"failures":1},"asserts":[{"number":1,"comment":null,"name":"todo # TODO","ok":false,"extra":{}}]}' diff --git a/test/snapshots/test.js.snap b/test/snapshots/test.js.snap index fd8303e5c07557adda4f6a51cc9402e94918f9da..14b71473bb1da3e1923badc54e2a442fe52e81d2 100644 GIT binary patch literal 3345 zcmV+s4es(mRzV7cF8!$PJ4StG)v~IQ5rB>0Zb-`ABtrn?BU7=F7T6uFP3CRrvf)pQWbND$k-^@SDKmRg!X2!Mw zAPB$<0o0ufNr&csdbDkSuyzCl^sgPF)`K!n-f}%0Sd|jE{qV%Zu@Ix3EC6WpMXqaE z^@L7Ue-yE^E&u{zbR(kn-%T56JLAjsk;2_&MHjlvf*4)Y3IO|A^QVxj`UFVD`a2wyP4L#1-^lIAx0-6>XIJS(>lK7-rcUgfq5|&)exf@h#dPn z&RDSV08j<(58e7kWe14SC5XtcBRX1^_KE1r6-C{Rw+Vt6T}_u%gmH^ETdgbjpi_9S z&^^N-M!&NH!1W~Oc<7qs2kZ_HK6@Im%O7Gi8_CD@riUbc=bA#d6|P^uNv?hhF*?v1 z0FLS?7!%vG-JD#z6&oBpw?d5i+W_Fky|L9=oGI^WIrN|^)!`V#XbK{(TV|~LhN?Z! z*k0RW%bo8*jCOqk0BX~*6#=qc=hjS~@Y}3OZsic8n-Tf$b>{|KKgw8^;}yJY()?tI zQNOlm6pqys;~$6H|2p=8DD=WqG*cQ4M-;r^*?}p?W=FPG^1sYJH|#5j(Vq~F2vTK~ z<#bE>y;Z^ZJi8-LAV#a{k{_3M4H(U}4+QVC7jD_{1;l75TJmrkyT9J&fQ{AcqCcc2Bk3+a;%)eUWg?;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DhLZt%$IS- zUtx4;nV7CW9*m^%&^ylEkTmW(!*tnIq2BDQ(PtWEKGUcQGi^C+%(QBhLW(h~lzvu8 z!>p3kE`^7Hg;_?{aF&^=^`?wrF#V4hvmVr1>ePn1cz;zv=_IRFIxXH580wpa<&9;) zeqg>%lQmMOg$z4{wX(Ts2hlKhcX?0k;}1voY=wA)=vYV6lEj3NkDK_y@I9LGX1kK* zySme=h3LN;R_O@s6C~DeWTIRyQKjfLL{FH8o(3#FPNGoIrI$2d^ec50-BHbgb)xkE zDc7k$11uk%ZS;{TAC*a^pP$tXndr${-m@oT(bNw%d?(P*xlX^-qE(wUxvovkOs=jV zS~$N(y-72@QIWw@yu#u^^)2L>Mza>XDmcsJILqBuwc!n1XS^O+rY5tiWtv$uf}spv z*DO=UWLL8hXwisQFM6J)i(VN_>587nxad*k76z$RW9_KJ<%%*rbCmJSk^kc5YMHsc zNJFY?wX|g^7XzNU7!b0g`fC+65e5}JywR^U82?3J_zwcs?4&i$&g-8Y){JzoY)0x& ziGDpkXL+l=Id9dA9Y{TJlG#V*hP*SXxkqO3IvOx_23M_-Xw+Qs46fDybV>5L_&fFJ zQpo4(zjTD~RKB58h5PGD3s;Q0bNO6)0XMXiQ@P?8Nt{~7=gN{bDhU#o znmRs}6(gU3*QN_syFEdDNG^?PcPFSx(fxIs6Vybz6K*-Zy{t^>?P<_k#MGOzL~mUM zG^lO>XzewsM3y7@1~ydfo6nHuZmcwGonfnQe5(>eM777-gUOmMq6Th^6V%H2cry9W zb;iJlafoSQ^glKk{gfe!$SOyFy^bOy^Rp^TewO({OU { - return execa.shell(cmd) - .catch(err => err) - .then(result => result.stdout); +const exec = async cmd => { + const {stdout} = await execa.command(cmd, {reject: false, shell: true}) + return stdout; }; const reporters = [ @@ -19,19 +19,20 @@ const reporters = [ 'tap-json' ]; -const fixtures = fs.readdirSync(`${__dirname}/fixtures`); +const fixtures = fs.readdirSync(path.join(__dirname, 'fixtures')); reporters.forEach(reporter => { fixtures.forEach(fixture => { - const path = `${__dirname}/fixtures/${fixture}`; + const fixturePath = path.join(__dirname, 'fixtures', fixture); const name = fixture.replace('.js', ''); test(`${reporter} - ${name}`, async t => { - let stdout = await exec(`node ${path} | ${__dirname}/../node_modules/.bin/${reporter}`); + const reporterBinPath = path.join(__dirname, '..', 'node_modules', '.bin', reporter); + let stdout = await exec(`node ${fixturePath} | ${reporterBinPath}`); // Strip duration from output, because it's dynamic and breaking snapshots if (reporter === 'tap-spec' || reporter === 'tap-summary' || reporter === 'tap-min') { - stdout = stdout.replace(/([0-9]+)ms/g, ''); + stdout = stdout.replace(/(\d+)ms/g, ''); } t.snapshot(stdout);