Skip to content

Tweak vitest/no-standalone-expect rule - #4010

Merged
nstepien merged 2 commits into
mainfrom
standalone
Mar 18, 2026
Merged

nstepien merged 2 commits into
mainfrom
standalone

Conversation

@nstepien

Copy link
Copy Markdown
Collaborator

No description provided.

@nstepien nstepien self-assigned this Mar 18, 2026
Comment thread test/failOnConsole.ts
let consoleErrorOrConsoleWarnWereCalled = false;

beforeAll(() => {
// replace instead of mutating `console` to avoid infinite loops

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Probably hasn't been an issue for a while.
Maybe it was an issue with an older implementation of failOnConsole, or with JSDOM?

Comment thread test/failOnConsole.ts
)
.toBe(false);
// avoid failing test runs twice
if (task.result!.state !== 'fail' || signal.aborted) {

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

That way if a test fails AND has logs, we won't focus on both why the test failed and the fact that the test logged errors/warnings, so that devs can focus on the test failure first, which in most cases will also resolve the logs. Also good for agents I suspect.

Image Image

Comment thread .vscode/settings.json
"typescript.enablePromptUseWorkspaceTsdk": true,
"typescript.tsdk": "node_modules/typescript/lib",
"js/ts.tsdk.promptToUseWorkspaceVersion": true,
"js/ts.tsdk.path": "node_modules/typescript/lib",

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Turns out these two are deprecated in favor of these new settings.
I had odd eslint warnings in vscode but not in the cli, that's how I found out.

@nstepien
nstepien marked this pull request as ready for review March 18, 2026 14:51
@nstepien
nstepien requested a review from amanmahajan7 as a code owner March 18, 2026 14:51
@nstepien
nstepien merged commit 154a598 into main Mar 18, 2026
1 check passed
@nstepien
nstepien deleted the standalone branch March 18, 2026 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants