Skip to content
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

chore(ssr): use test options for expected failures #4844

Merged
merged 1 commit into from
Nov 13, 2024

Conversation

cardoso
Copy link
Contributor

@cardoso cardoso commented Nov 12, 2024

Details

Follow up to #4816.

Uses vitest's built-in support for expected failures.

I also removed description from TestFixtureConfig since it's unused.

Does this pull request introduce a breaking change?

  • 😮‍💨 No, it does not introduce a breaking change.

Does this pull request introduce an observable change?

  • 🤞 No, it does not introduce an observable change.

GUS work item

@cardoso cardoso requested a review from a team as a code owner November 12, 2024 22:29
@wjhsf
Copy link
Contributor

wjhsf commented Nov 13, 2024

I also removed description from TestFixtureConfig since it's unused.

That's because we have too many test fixtures to add it all at once and I haven't gotten around to it yet. 😅 #4851

@cardoso
Copy link
Contributor Author

cardoso commented Nov 13, 2024

@wjhsf totally get it!

I think the config.json should only affect how the fixture is processed by the test not the test itself. Same with ssrFiles. This couples test collection and execution which makes it difficult to reuse logic and blocks some possible perf gains.

It's not huge right now, but could be an issue in the near future. Eg:

describe.concurrent('fixtures', () => {
describe.concurrent('default', () => {
testFixtures();
});
// Test with and without the static content optimization to ensure the fixtures are the same
describe.concurrent('enableStaticContentOptimization=false', () => {
testFixtures({ enableStaticContentOptimization: false });
});
});

Each suite adds +2s on my M1 Max.

Copy link
Collaborator

@nolanlawson nolanlawson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, this is neat! TIL. 🙂 Thanks!

@nolanlawson
Copy link
Collaborator

/nucleus test

@nolanlawson
Copy link
Collaborator

/nucleus test

@nolanlawson nolanlawson merged commit 2efbadf into salesforce:master Nov 13, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants