Repository navigation
test: run the bubble, polarArea and radar controller specs under Vitest - #12498
Merged
kurkle merged 1 commit intoNov 25, 2026
Merged
Conversation
Rename controller.{bubble,polarArea,radar}.tests.js to *.spec.js and
convert the Jasmine idioms with the table in the migrate-tests-to-vitest
design (D5). The fixture lines go, since fixtures.spec.js runs those
directories already.
A numeric withContext(i) becomes expect(x, `${i}`): Vitest drops a falsy
message, so expect(x, 0) would lose the context of the first element.
|
Size Change: 0 B Total Size: 363 kB ℹ️ View Unchanged
|
✅ Deploy Preview for chartjs-docs canceled.
|
kurkle
marked this pull request as ready for review
November 25, 2026 15:44
etimberg
approved these changes
Nov 25, 2026
This was referenced Nov 26, 2026
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.
Piece P5 of
openspec/changes/migrate-tests-to-vitest. It follows #12436 (Vitest beside Karma) and #12444 (fixtures under Vitest).What was missing
controller.bubble,controller.polarAreaandcontroller.radarstill ran under Karma/Jasmine. No open pull request touches these three spec files.What changed
Each file is renamed with
git mvfrom*.tests.jsto*.spec.js, so git follows the rename (81-91% similarity), and the idioms are converted with the table in design D5:describe('auto', jasmine.fixture.specs(...))fixtures.spec.jsalready runs these directoriesspyOn(o, 'draw')vi.spyOn(o, 'draw').mockImplementation(() => {}).calls.count().mock.calls.lengthjasmine.objectContainingexpect.objectContainingjasmine.triggerMouseEvent(triggerMouseEvent(this.chartin theInteractionshooks and testslet chartin thatdescribeexpect(x).withContext(i)expect(x, `${i}`)toEqualstaystoEqual. No imports are added.Numeric contexts become template strings. In each case the context is a loop index that starts at 0. Vitest drops a falsy message, so
expect(x, 0)would lose the context that Jasmine'swithContext(0)shows. I checked this with a probe spec in Chromium:expect(10, 3).toBeCloseToPixel(20)fails with3: Expected 10 to be close to pixel 20.expect({a: 1}, 2).toEqual(expect.objectContaining({a: 5}))fails with2: expected { a: 1 } to deeply equal ....expect(1, 0).toBe(2)fails with onlyexpected 1 to be 2 // Object.is equality. The0is gone.expect(x, `${i}`)keeps the context for every index. Only failure messages differ, never which tests pass.openspec/changes/migrate-tests-to-vitest/tasks.md: section 5 is ticked.Counts
Local runs on macOS, full suite of each runner, per browser:
jasmine.fixture.specslines.--grepon each file before the change gave 19, 15 and 14 per browser: the 45 tests plus the 3 placeholders.plugin.filler/line,scale.time,scale.timeseriesandscale.radialLinear/ticks-below-zero. These are known macOS rendering differences; CI on Ubuntu is the judge. All 90 runs of the converted specs pass (45 tests in each of the two browsers).How to try it