From befc4f89a9d593e4541deed7b0e29e36d08ce466 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ari=20Perkki=C3=B6?= Date: Mon, 11 Jul 2022 21:15:45 +0300 Subject: [PATCH] fix: logger API changes from `vitest@0.18.0` (#16) - Ref. vitest-dev/vitest#1166 --- package.json | 4 ++-- src/sonar-reporter.ts | 2 +- test/index.test.ts | 54 +++++++++++++++++++++---------------------- yarn.lock | 8 +++---- 4 files changed, 34 insertions(+), 34 deletions(-) diff --git a/package.json b/package.json index 5232921..491d6ea 100644 --- a/package.json +++ b/package.json @@ -38,10 +38,10 @@ "prettier": "^2.6.0", "typescript": "^4.6.2", "vite": "^2.9.14", - "vitest": "^0.17.1" + "vitest": "^0.18.0" }, "peerDependencies": { - "vitest": ">=0.11.0" + "vitest": ">=0.18.0" }, "keywords": [ "vitest", diff --git a/src/sonar-reporter.ts b/src/sonar-reporter.ts index a32bc30..0ffa537 100644 --- a/src/sonar-reporter.ts +++ b/src/sonar-reporter.ts @@ -36,7 +36,7 @@ export default class SonarReporter implements Reporter { } writeFileSync(reportFile, generateXml(files), 'utf-8'); - this.ctx.log(`SonarQube report written to ${reportFile}`); + this.ctx.logger.log(`SonarQube report written to ${reportFile}`); } } diff --git a/test/index.test.ts b/test/index.test.ts index c33a1b2..e3a7a57 100644 --- a/test/index.test.ts +++ b/test/index.test.ts @@ -33,15 +33,15 @@ test('writes a report', () => { /test/fixtures/animals.test.ts:15:47 - at /node_modules/vitest/dist/chunk-runtime-chain.6d23d202.mjs:1938:36 - at /node_modules/vitest/dist/chunk-runtime-chain.6d23d202.mjs:1826:26 - at runTest (/node_modules/vitest/dist/vendor-entry.1ad8a08d.mjs:487:40) - at async runSuite (/node_modules/vitest/dist/vendor-entry.1ad8a08d.mjs:570:13) - at async runSuite (/node_modules/vitest/dist/vendor-entry.1ad8a08d.mjs:570:13) - at async runSuite (/node_modules/vitest/dist/vendor-entry.1ad8a08d.mjs:570:13) - at async runFiles (/node_modules/vitest/dist/vendor-entry.1ad8a08d.mjs:610:5) - at async startTests (/node_modules/vitest/dist/vendor-entry.1ad8a08d.mjs:617:3) - at async /node_modules/vitest/dist/vendor-entry.1ad8a08d.mjs:661:9]]> + at /node_modules/vitest/dist/chunk-runtime-chain.eb764dff.mjs:1938:36 + at /node_modules/vitest/dist/chunk-runtime-chain.eb764dff.mjs:1826:26 + at runTest (/node_modules/vitest/dist/vendor-entry.78de67ab.mjs:487:40) + at async runSuite (/node_modules/vitest/dist/vendor-entry.78de67ab.mjs:570:13) + at async runSuite (/node_modules/vitest/dist/vendor-entry.78de67ab.mjs:570:13) + at async runSuite (/node_modules/vitest/dist/vendor-entry.78de67ab.mjs:570:13) + at async runFiles (/node_modules/vitest/dist/vendor-entry.78de67ab.mjs:610:5) + at async startTests (/node_modules/vitest/dist/vendor-entry.78de67ab.mjs:617:3) + at async /node_modules/vitest/dist/vendor-entry.78de67ab.mjs:661:9]]> @@ -54,30 +54,30 @@ test('writes a report', () => { /test/fixtures/math.test.ts:15:42 - at /node_modules/vitest/dist/chunk-runtime-chain.6d23d202.mjs:1938:36 - at /node_modules/vitest/dist/chunk-runtime-chain.6d23d202.mjs:1826:26 - at runTest (/node_modules/vitest/dist/vendor-entry.1ad8a08d.mjs:487:40) - at async runSuite (/node_modules/vitest/dist/vendor-entry.1ad8a08d.mjs:570:13) - at async runSuite (/node_modules/vitest/dist/vendor-entry.1ad8a08d.mjs:570:13) - at async runFiles (/node_modules/vitest/dist/vendor-entry.1ad8a08d.mjs:610:5) - at async startTests (/node_modules/vitest/dist/vendor-entry.1ad8a08d.mjs:617:3) - at async /node_modules/vitest/dist/vendor-entry.1ad8a08d.mjs:661:9 - at async withEnv (/node_modules/vitest/dist/vendor-entry.1ad8a08d.mjs:171:5)]]> + at /node_modules/vitest/dist/chunk-runtime-chain.eb764dff.mjs:1938:36 + at /node_modules/vitest/dist/chunk-runtime-chain.eb764dff.mjs:1826:26 + at runTest (/node_modules/vitest/dist/vendor-entry.78de67ab.mjs:487:40) + at async runSuite (/node_modules/vitest/dist/vendor-entry.78de67ab.mjs:570:13) + at async runSuite (/node_modules/vitest/dist/vendor-entry.78de67ab.mjs:570:13) + at async runFiles (/node_modules/vitest/dist/vendor-entry.78de67ab.mjs:610:5) + at async startTests (/node_modules/vitest/dist/vendor-entry.78de67ab.mjs:617:3) + at async /node_modules/vitest/dist/vendor-entry.78de67ab.mjs:661:9 + at async withEnv (/node_modules/vitest/dist/vendor-entry.78de67ab.mjs:171:5)]]> /test/fixtures/math.test.ts:18:38 - at /node_modules/vitest/dist/chunk-runtime-chain.6d23d202.mjs:1938:36 - at /node_modules/vitest/dist/chunk-runtime-chain.6d23d202.mjs:1826:26 - at runTest (/node_modules/vitest/dist/vendor-entry.1ad8a08d.mjs:487:40) - at async runSuite (/node_modules/vitest/dist/vendor-entry.1ad8a08d.mjs:570:13) - at async runSuite (/node_modules/vitest/dist/vendor-entry.1ad8a08d.mjs:570:13) - at async runFiles (/node_modules/vitest/dist/vendor-entry.1ad8a08d.mjs:610:5) - at async startTests (/node_modules/vitest/dist/vendor-entry.1ad8a08d.mjs:617:3) - at async /node_modules/vitest/dist/vendor-entry.1ad8a08d.mjs:661:9 - at async withEnv (/node_modules/vitest/dist/vendor-entry.1ad8a08d.mjs:171:5)]]> + at /node_modules/vitest/dist/chunk-runtime-chain.eb764dff.mjs:1938:36 + at /node_modules/vitest/dist/chunk-runtime-chain.eb764dff.mjs:1826:26 + at runTest (/node_modules/vitest/dist/vendor-entry.78de67ab.mjs:487:40) + at async runSuite (/node_modules/vitest/dist/vendor-entry.78de67ab.mjs:570:13) + at async runSuite (/node_modules/vitest/dist/vendor-entry.78de67ab.mjs:570:13) + at async runFiles (/node_modules/vitest/dist/vendor-entry.78de67ab.mjs:610:5) + at async startTests (/node_modules/vitest/dist/vendor-entry.78de67ab.mjs:617:3) + at async /node_modules/vitest/dist/vendor-entry.78de67ab.mjs:661:9 + at async withEnv (/node_modules/vitest/dist/vendor-entry.78de67ab.mjs:171:5)]]> diff --git a/yarn.lock b/yarn.lock index a5804fb..caf235b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1534,10 +1534,10 @@ v8-compile-cache@^2.0.3: optionalDependencies: fsevents "~2.3.2" -vitest@^0.17.1: - version "0.17.1" - resolved "https://registry.yarnpkg.com/vitest/-/vitest-0.17.1.tgz#0387535624538bfc1fe1a69fac617cca059428e2" - integrity sha512-d6NsFC6FPmZ5XdiSYfW5rwJ/b8060wqe2steNNlVbhO69HWma6CucIm5g7PXlCSkmKvrdEbUsZHPAarlH83VGw== +vitest@^0.18.0: + version "0.18.0" + resolved "https://registry.yarnpkg.com/vitest/-/vitest-0.18.0.tgz#a9b59213ee6917e9da0797a2e1d7cb52b8f1b644" + integrity sha512-ryAtlh5Gvg3+aLNuOQ8YOHxgQCCu46jx40X5MBL0K0/ejB9i5zsr8fV8LTGXbXex80UMHlzceI9F+ouGaiR+mQ== dependencies: "@types/chai" "^4.3.1" "@types/chai-subset" "^1.3.3"