From 0b0c8f7e273cab33f07456fd456fd2d0810d8988 Mon Sep 17 00:00:00 2001 From: Austin Akers Date: Thu, 15 Feb 2024 15:49:30 -0800 Subject: [PATCH 1/3] bumped istanbul-lib-instrument to pendng 6.0.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 94fe276b..32d3b20f 100644 --- a/package.json +++ b/package.json @@ -68,7 +68,7 @@ "glob": "^7.1.6", "istanbul-lib-coverage": "^3.0.0", "istanbul-lib-hook": "^3.0.0", - "istanbul-lib-instrument": "^4.0.0", + "istanbul-lib-instrument": "^6.0.2", "istanbul-lib-processinfo": "^2.0.2", "istanbul-lib-report": "^3.0.0", "istanbul-lib-source-maps": "^4.0.0", From 522f290fcbc244f128de842b4f62bec2e263bf9c Mon Sep 17 00:00:00 2001 From: Austin Akers Date: Mon, 15 Apr 2024 14:21:53 -0700 Subject: [PATCH 2/3] updated test-success, convert buffer to string, added fix script --- .github/workflows/release-please.yml | 1 - package-lock.json | 49 +++++++++++++++---- package.json | 1 + .../test/nyc-integration.js.test.cjs | 2 +- test/helpers/run-nyc.js | 8 +-- test/helpers/test-success.js | 3 +- test/nyc-integration.js | 3 +- 7 files changed, 49 insertions(+), 18 deletions(-) diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index a8702b74..4882de22 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -21,7 +21,6 @@ jobs: - uses: actions/setup-node@v3 with: node-version: 16 - registry-url: 'https://external-dot-oss-automation.appspot.com' cache: npm if: ${{ steps.release.outputs.release_created }} - run: npm publish diff --git a/package-lock.json b/package-lock.json index 53909214..64aaef63 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21,7 +21,7 @@ "glob": "^7.1.6", "istanbul-lib-coverage": "^3.0.0", "istanbul-lib-hook": "^3.0.0", - "istanbul-lib-instrument": "^4.0.0", + "istanbul-lib-instrument": "^6.0.2", "istanbul-lib-processinfo": "^2.0.2", "istanbul-lib-report": "^3.0.0", "istanbul-lib-source-maps": "^4.0.0", @@ -6622,19 +6622,50 @@ } }, "node_modules/istanbul-lib-instrument": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.3.tgz", - "integrity": "sha512-BXgQl9kf4WTCPCCpmFGoJkz/+uhvm7h7PFKUYxh7qarQd3ER33vHG//qaE8eN25l07YqZPpHXU9I09l/RD5aGQ==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.2.tgz", + "integrity": "sha512-1WUsZ9R1lA0HtBSohTkm39WTPlNKSJ5iFk7UwqXkBLoHQT+hfqPsfsTDVuZdKGaBwn7din9bS7SsnoAr943hvw==", "dependencies": { - "@babel/core": "^7.7.5", - "@istanbuljs/schema": "^0.1.2", - "istanbul-lib-coverage": "^3.0.0", - "semver": "^6.3.0" + "@babel/core": "^7.23.9", + "@babel/parser": "^7.23.9", + "@istanbuljs/schema": "^0.1.3", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^7.5.4" }, "engines": { - "node": ">=8" + "node": ">=10" + } + }, + "node_modules/istanbul-lib-instrument/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" } }, + "node_modules/istanbul-lib-instrument/node_modules/semver": { + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-instrument/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + }, "node_modules/istanbul-lib-processinfo": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/istanbul-lib-processinfo/-/istanbul-lib-processinfo-2.0.3.tgz", diff --git a/package.json b/package.json index b3364119..acededa2 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,7 @@ "pretest": "npm run lint && npm run clean && npm run instrument", "test": "tap", "snap": "npm test -- --snapshot", + "fix": "standard --fix", "posttest": "npm run report", "clean": "node ./npm-run-clean.js", "instrument": "node ./build-self-coverage.js", diff --git a/tap-snapshots/test/nyc-integration.js.test.cjs b/tap-snapshots/test/nyc-integration.js.test.cjs index 5a707ec3..fd1763e8 100644 --- a/tap-snapshots/test/nyc-integration.js.test.cjs +++ b/tap-snapshots/test/nyc-integration.js.test.cjs @@ -888,7 +888,7 @@ exports[`test/nyc-integration.js > TAP > passes configuration via environment va ` exports[`test/nyc-integration.js > TAP > recursive run does not throw > stdout 1`] = ` - +Buffer <2268 656c 6c6f 220d 0a "hello"..> ` exports[`test/nyc-integration.js > TAP > report and check should show coverage check along with report > stderr 1`] = ` diff --git a/test/helpers/run-nyc.js b/test/helpers/run-nyc.js index ca0adcec..5549b23b 100644 --- a/test/helpers/run-nyc.js +++ b/test/helpers/run-nyc.js @@ -13,7 +13,7 @@ if ('APPDATA' in process.env) { envPath.APPDATA = process.env.APPDATA } -function sanitizeString (str, cwd, leavePathSep) { +function sanitizeString(str, cwd, leavePathSep) { /* * File paths are different on different systems: * - make everything relative to cwd @@ -31,7 +31,7 @@ function sanitizeString (str, cwd, leavePathSep) { return str } -async function runNYC ({ args, tempDir, leavePathSep, cwd = fixturesCLI, env = {} }) { +async function runNYC({ args, tempDir, leavePathSep, cwd = fixturesCLI, env = {} }) { const runArgs = [nycBin].concat(tempDir ? ['--temp-dir', tempDir] : [], args) const { status, stderr, stdout } = await spawn(process.execPath, runArgs, { cwd: cwd, @@ -47,8 +47,8 @@ async function runNYC ({ args, tempDir, leavePathSep, cwd = fixturesCLI, env = { stderr, stdout }, - stderr: sanitizeString(stderr, cwd, leavePathSep), - stdout: sanitizeString(stdout, cwd, leavePathSep) + stderr: sanitizeString(stderr.toString('utf8'), cwd, leavePathSep), + stdout: sanitizeString(stdout.toString('utf8'), cwd, leavePathSep) } } diff --git a/test/helpers/test-success.js b/test/helpers/test-success.js index 1a982789..713cf1f4 100644 --- a/test/helpers/test-success.js +++ b/test/helpers/test-success.js @@ -2,7 +2,7 @@ const runNYC = require('./run-nyc') -async function testSuccess (t, opts) { +async function testSuccess(t, opts) { const { status, stderr, stdout } = await runNYC({ tempDir: t.tempDir, ...opts @@ -10,7 +10,6 @@ async function testSuccess (t, opts) { t.equal(status, 0) t.equal(stderr, '') - console.info(stdout) t.matchSnapshot(stdout, 'stdout') } diff --git a/test/nyc-integration.js b/test/nyc-integration.js index 0ab1ece2..e510b2d9 100644 --- a/test/nyc-integration.js +++ b/test/nyc-integration.js @@ -591,7 +591,8 @@ t.test('recursive run does not throw', t => testSuccess(t, { nycBin, process.execPath, nycBin, - 'true' + 'echo', + 'hello' ], cwd: path.resolve(__dirname, 'fixtures/recursive-run') })) From d840901a17aa8af48a52e1fe7f30133dd190488a Mon Sep 17 00:00:00 2001 From: Austin Akers Date: Mon, 15 Apr 2024 14:29:29 -0700 Subject: [PATCH 3/3] ran npm run fix --- test/helpers/run-nyc.js | 4 ++-- test/helpers/test-success.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/helpers/run-nyc.js b/test/helpers/run-nyc.js index 5549b23b..04bd5bf1 100644 --- a/test/helpers/run-nyc.js +++ b/test/helpers/run-nyc.js @@ -13,7 +13,7 @@ if ('APPDATA' in process.env) { envPath.APPDATA = process.env.APPDATA } -function sanitizeString(str, cwd, leavePathSep) { +function sanitizeString (str, cwd, leavePathSep) { /* * File paths are different on different systems: * - make everything relative to cwd @@ -31,7 +31,7 @@ function sanitizeString(str, cwd, leavePathSep) { return str } -async function runNYC({ args, tempDir, leavePathSep, cwd = fixturesCLI, env = {} }) { +async function runNYC ({ args, tempDir, leavePathSep, cwd = fixturesCLI, env = {} }) { const runArgs = [nycBin].concat(tempDir ? ['--temp-dir', tempDir] : [], args) const { status, stderr, stdout } = await spawn(process.execPath, runArgs, { cwd: cwd, diff --git a/test/helpers/test-success.js b/test/helpers/test-success.js index 713cf1f4..0841cbc3 100644 --- a/test/helpers/test-success.js +++ b/test/helpers/test-success.js @@ -2,7 +2,7 @@ const runNYC = require('./run-nyc') -async function testSuccess(t, opts) { +async function testSuccess (t, opts) { const { status, stderr, stdout } = await runNYC({ tempDir: t.tempDir, ...opts