Conversation
5ea6a23 to
635d2aa
Compare
mbostock
left a comment
There was a problem hiding this comment.
I bet we could make these change without having to regenerate all the snapshots… we could do some preprocessing to address the precision issue. That would make it easier to review and ensure that this isn’t introducing any unexpected changes.
This comment was marked as outdated.
This comment was marked as outdated.
64ea8b9 to
c2e0667
Compare
|
Edit: OBSOLETE
Our snapshots in main, using mocha, are in fact wrong because the I created a This should make it easier to review. All the changes to snapshots are in #2375. |
|
Can’t we get the tests to pass as-is? That would give me more confidence that we’re testing correctly. I’m going to look at that now; I don’t understand yet why the tests are failing in this branch. |
|
Ooooohkay, I’m just slow. The tests aren’t passing here because
We don’t have this problem with main and Mocha because we normalize both the actual result and the expected result (i.e., the snapshot) before doing the exact comparison. (We also strip images in main, but that’s handled in this branch by the new So I guess we should just avoid |
|
This passes now but I still want to do two things: first, I want to think about the design of |
mbostock
left a comment
There was a problem hiding this comment.
This works pretty well, but there are a few outstanding issues.
First, a minor annoyance is that all the snapshot tests are now lumped under test/plot.js, so you can’t see the individual tests run.
Second, editing any snapshot test causes all snapshot tests to rerun; this is related to the first problem. (I think this also causes u to update all snapshots rather than just the test that failed, but I’m not sure, as all the snapshots need to be regenerated anyway and we haven’t yet adopted toMatchFileSnapshot.)
I think we can declare the tests in source to fix…
mbostock
left a comment
There was a problem hiding this comment.
Almost there… the import.meta.vitest boilerplate is annoying, but I don’t think there’s a better fix. I should fix or remove this, though: Warning: No files were found with the provided path: test/output/*-changed.*. No artifacts will be uploaded. We don’t generate these now, so it’s hard to see how a test failed, and there’s no artifact generated in CI when tests fail.
|
Things work, but I still haven’t removed the Also to note that the tests seem to take 4+ minutes with VItest, while they only took 50 seconds with Mocha. 😩 Not sure what could be causing such a slowdown but likely worth investigating… |
Replace mocha by vitest as the preferred test framework
AI disclosure: I used @claude to generate a first draft this PR.