Conversation
Vitest 5 removed the `vitest/reporters` subpath and no longer installs `@vitest/runner` as a separate package. The reporter imported `Reporter` and `TestAnnotation` from those modules, so the published `.d.ts` failed with TS2307 in consumer projects using `skipLibCheck: false`. Import `Reporter` from `vitest/node` and `TestAnnotation` from `vitest`; both are exported there in Vitest 3, 4 and 5. The imports are type-only, so runtime behaviour is unchanged. Also bump the `vitest` devDependency to `^5.0.2` (5.0.3 is still inside the repo's `min-release-age` window), update the README requirements, and bump the package to 1.5.1.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
[email protected]runs fine on Vitest 5, but its type declarations break: Vitest 5 removed thevitest/reporterssubpath and no longer installs@vitest/runneras a separate package. TypeScript projects withskipLibCheck: falsefail withTS2307when importingvitest-qase-reporter.Reporteris now imported fromvitest/node(merged with the existingTestCase/TestSuiteimport)TestAnnotationis now imported fromvitestvitestdevDependency bumped^4.1.11→^5.0.2(5.0.3 is still inside the repo'smin-release-age=3window);peerDependenciesstays>=3.0.0>=18(matchesengines), Vitest>=3.0.0 (tested with 3.x, 4.x and 5.x)1.5.1, changelog entry addedVerification
Packed
[email protected]and ranexamples/single/vitestinreportmode against each Vitest version:tsc(skipLibCheck: false)The 2 failures are intentional in the example. In package:
npm run build,npm run lint(0 errors),npm test(76/76) pass with Vitest 5.0.2.Not addressed
qase-javascript-commons/dist/options/composeOptions.d.tsreferencesMergeWithCustomizer(lodash types), which failstscwithskipLibCheck: falseon every Vitest version. It is a pre-existing commons issue affecting all reporters and is left for a separate fix.