From 335c51f76188d86ecb194fb05e6fdd9ea7debebf Mon Sep 17 00:00:00 2001 From: Christophe Hurpeau <302891+christophehurpeau@users.noreply.github.com> Date: Thu, 15 Aug 2024 16:43:58 +0200 Subject: [PATCH] chore: use node experimental-test-coverage --- .github/workflows/gh-pages.yml | 6 +----- lib/checkfile.js | 3 +++ package.json | 6 +++--- 3 files changed, 7 insertions(+), 8 deletions(-) create mode 100644 lib/checkfile.js diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 021c8ae..b238c88 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -20,12 +20,8 @@ jobs: - name: Install Dependencies run: yarn install --immutable - - name: Configure c8 - run: | - echo '{"reports-dir": "docs/coverage"}' > .c8rc.json - - name: Generate Coverage - run: yarn test:coverage:lcov + run: NODE_V8_COVERAGE=./docs/coverage yarn test:coverage:lcov - name: Create nojekyll run: touch docs/.nojekyll diff --git a/lib/checkfile.js b/lib/checkfile.js new file mode 100644 index 0000000..943a14d --- /dev/null +++ b/lib/checkfile.js @@ -0,0 +1,3 @@ +export function notUsed() { + console.log("not used"); +} diff --git a/package.json b/package.json index 8aeebb7..2802866 100644 --- a/package.json +++ b/package.json @@ -44,9 +44,9 @@ "postinstallDev": "pob-root-postinstall", "test": "node --test lib/**/*.test.js", "test-typings": "tsc -p typings/tsconfig.json", - "test:coverage": "npx c8 --src ./lib node --test lib/**/*.test.js", - "test:coverage:json": "npx c8 --reporter=json --src ./lib node --test lib/**/*.test.js", - "test:coverage:lcov": "npx c8 --reporter=lcov --src ./lib node --test lib/**/*.test.js", + "test:coverage": "node --test --experimental-test-coverage lib/**/*.test.js", + "test:coverage:json": "node --test --experimental-test-coverage lib/**/*.test.js", + "test:coverage:lcov": "node --test --experimental-test-coverage --test-reporter=lcov lib/**/*.test.js", "test:watch": "node --test lib/**/*.test.js" }, "commitlint": {