Repository navigation
Tests: fail on Vue warnings - #121
Merged
Merged
Conversation
test-setup.ts records every [Vue warn] and fails the test that emitted it, unless the test allows it with expectVueWarning(pattern).
✅ Incremental coverage — 100%
4 files not graded (3 ignored by pattern, 1 not a source file)
Coverage reports: coverage.json (coverage.py, 76 files) · coverage/clover.xml (clover, 18 files) — incremental-coverage-check v3.1.0 |
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.
Test-only change: no version bump, no changelog entry.
vue/test-utils/vue-warnings.ts(same helper as in vuetify-inputs):vue/test-setup.ts, now the vitestsetupFiles, records every[Vue warn]and fails the test that emitted it inafterEach. A test that asserts a warning callsexpectVueWarning(pattern); the matching warning is then not printed, and the test fails if no warning matches.vue/test-utils/vue-warnings.spec.ts: an expected warning passes, an unexpected one and an expected one that is not emitted fail, other console warnings are ignored.vue/test-setup.tsadded to the incremental coverage check's ignore patterns (a setupFile never appears in the coverage report).Unit run (
npx vitest run --reporter=default): 516 tests pass, 0 Vue warnings (before: 512 tests, 0 Vue warnings). A probe spec calling Vue'swarn()fails withunexpected: [Vue warn]: ….Changed existing tests: none.