From ea65c5a13a3611478eda9096c85e41390f888aba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Wed, 10 Jan 2024 09:47:28 +0100 Subject: [PATCH] chore: update dependencies Most notably `tap`. --- .gitignore | 1 + package.json | 19 ++++++----- test/fixtures/parsed-tap.json | 52 ++++++++++++++++++++++-------- test/reporter/test-reporter-tap.js | 7 ++-- 4 files changed, 53 insertions(+), 26 deletions(-) diff --git a/.gitignore b/.gitignore index 0be52c37f..c457c2e32 100644 --- a/.gitignore +++ b/.gitignore @@ -2,5 +2,6 @@ node_modules/ test/scaffold/*/node_modules test/.* coverage/ +/.tap .nyc_output/ .eslintcache diff --git a/package.json b/package.json index 6831aa22e..2c74d61da 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ ], "scripts": { "lint": "eslint bin/* lib/ test/ --cache", - "tap": "c8 --reporter lcov tap --no-coverage \"test/**/test-*.js\"", + "tap": "tap run \"test/**/test-*.js\"", "test": "npm run lint && npm run tap" }, "author": "James M Snell (http://jasnell.me)", @@ -31,7 +31,7 @@ "license": "MIT", "dependencies": { "async": "^3.2.5", - "bl": "^6.0.9", + "bl": "^6.0.10", "chalk": "^5.3.0", "columnify": "^1.6.0", "execa": "^8.0.1", @@ -39,7 +39,7 @@ "normalize-git-url": "^3.0.2", "npm-package-arg": "^11.0.1", "npm-which": "^3.0.1", - "pnpm": "^8.13.1", + "pnpm": "^8.14.0", "read-package-json": "^7.0.0", "root-check": "^2.0.0", "semver": "^7.5.4", @@ -47,24 +47,23 @@ "supports-color": "^9.4.0", "tar": "^6.2.0", "uid-number": "0.0.6", - "undici": "^6.2.1", + "undici": "^6.3.0", "which": "^4.0.0", "winston": "^3.11.0", - "xml-sanitizer": "^1.2.9", + "xml-sanitizer": "^2.0.0", "xmlbuilder": "^15.1.1", "yargs": "^17.7.2", "yarn": "^1.22.21" }, "devDependencies": { "ansi-regex": "^6.0.1", - "c8": "^8.0.1", "eslint": "^8.56.0", "eslint-config-prettier": "^9.1.0", - "eslint-plugin-prettier": "^5.1.2", + "eslint-plugin-prettier": "^5.1.3", "prettier": "^3.1.1", "string-to-stream": "^3.0.1", - "tap": "^16.3.8", - "tap-parser": "^11.0.1", + "tap": "^18.6.1", + "tap-parser": "^15.3.1", "xml2js": "^0.6.2" }, "prettier": { @@ -82,7 +81,7 @@ }, "tap": { "timeout": 480, - "check-coverage": false + "allow-incomplete-coverage": true }, "engines": { "node": "18.x || 20.x || 21.x" diff --git a/test/fixtures/parsed-tap.json b/test/fixtures/parsed-tap.json index d119eacee..e286f00a5 100644 --- a/test/fixtures/parsed-tap.json +++ b/test/fixtures/parsed-tap.json @@ -1,28 +1,52 @@ { - "bailout": false, + "ok": false, "count": 3, + "pass": 2, "fail": 1, + "bailout": false, + "todo": 0, + "skip": 1, "failures": [ { - "diag": { - "duration_ms": 50 - }, - "id": 3, + "ok": false, "name": "iFail v3.0.1 I dun wurk", - "fullname": "", - "ok": false + "id": 3, + "buffered": false, + "tapError": null, + "skip": false, + "todo": false, + "previous": null, + "plan": null, + "diag": {}, + "time": 50, + "fullname": "iFail v3.0.1 I dun wurk", + "closingTestPoint": false } ], - "ok": false, - "pass": 2, + "time": null, "plan": { - "comment": "", "start": 1, + "end": 3, "skipAll": false, "skipReason": "", - "end": 3 + "comment": "" }, - "skip": 1, - "todo": 0, - "time": null + "skips": [ + { + "ok": true, + "name": "iFlakyFail v3.3.3", + "id": 2, + "buffered": false, + "tapError": null, + "skip": "I dun wurk", + "todo": false, + "previous": null, + "plan": null, + "diag": {}, + "time": 50, + "fullname": "iFlakyFail v3.3.3", + "closingTestPoint": false + } + ], + "todos": [] } diff --git a/test/reporter/test-reporter-tap.js b/test/reporter/test-reporter-tap.js index 22cf135cc..594fd2533 100644 --- a/test/reporter/test-reporter-tap.js +++ b/test/reporter/test-reporter-tap.js @@ -6,7 +6,7 @@ import { tmpdir } from 'os'; import { fileURLToPath } from 'url'; import tap from 'tap'; -import Parser from 'tap-parser'; +import { Parser } from 'tap-parser'; import str from 'string-to-stream'; import tapReporter from '../../lib/reporter/tap.js'; @@ -92,7 +92,10 @@ test('reporter.tap(): parser', (t) => { tapReporter(logger, failingInput); const p = new Parser((results) => { - t.same(results, tapParserExpected), + // `results` contains JS classes that are not considered same as the + // plain objects loaded from the JSON file. + const plainResults = JSON.parse(JSON.stringify(results)); + t.same(plainResults, tapParserExpected), 'the tap parser should correctly' + ' parse the tap file'; t.end(); });