-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: Removing obsolete warning from undesired snapshots #4009
Conversation
Run & review this pull request in StackBlitz Codeflow. |
✅ Deploy Preview for fastidious-cascaron-4ded94 ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
|
||
getTasks(suite).forEach((suiteTask) => { | ||
if (suiteTask.mode === 'skip') { | ||
getTasks(suiteTask).forEach((task) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think there are any tasks here when suite is skipped. We skip collection phase altogether
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Weird, I was logging the tasks and they were there. The warning is also not happening anymore as reported in the issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, the tasks are there but they have mode: 'skip'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add more tests? Create a fixture with snapshots and a suite with .skip
. You can use test/test-utils/index.ts
to run Vitest on the fixture.
Then check that the output doesn't contain an error that there are obsolete snapshots
9c2a69a
to
19c4f7c
Compare
@sheremet-va Added the tests, not sure why the CI is failing though. |
}) | ||
} | ||
|
||
describe('snapshot should not be obsolete', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I run this test without your changes, it gives the same result. Your tests should validate that the change that you made is working.
If you just run this command in main, you can see that there are already no obsolete warnings. Please, create a test that actually tests things.
Description
This PR removes the
obsolete snapshot
warning from skipped suite tests.Related to #2442.
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
pnpm-lock.yaml
unless you introduce a new test example.Tests
pnpm test:ci
.Documentation
pnpm run docs
command.Changesets
feat:
,fix:
,perf:
,docs:
, orchore:
.