Skip to content

Conversation

@yjaaidi
Copy link
Contributor

@yjaaidi yjaaidi commented Oct 30, 2025

Description

Resolves #8883

Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. If the feature is substantial or introduces breaking changes without a discussion, PR might be closed.
  • Ideally, include a test that fails without this PR but passes with it.
  • Please, don't make changes to pnpm-lock.yaml unless you introduce a new test example.
  • Please check Allow edits by maintainers to make review process faster. Note that this option is not available for repositories that are owned by Github organizations.

Tests

  • Run the tests with pnpm test:ci.

Documentation

  • If you introduce new functionality, document it. You can run documentation with pnpm run docs command.

Changesets

  • Changes in changelog are generated from PR name. Please, make sure that it explains your changes in an understandable manner. Please, prefix changeset messages with feat:, fix:, perf:, docs:, or chore:.

@netlify
Copy link

netlify bot commented Oct 30, 2025

Deploy Preview for vitest-dev ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 298884d
🔍 Latest deploy log https://app.netlify.com/projects/vitest-dev/deploys/6903e0a53277dc0008cd506d
😎 Deploy Preview https://deploy-preview-8884--vitest-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

// if the mode is setup, we need to re-evaluate the setup file on each test run
if (mode === 'setup' || !hash) {
hash = Date.now().toString()
this.hashMap.set(filepath, hash)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Given we want to cache bust, is it useful to populate the hashMap when mode is setup?

if (!hash) {

// if the mode is setup, we need to re-evaluate the setup file on each test run
if (mode === 'setup' || !hash) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure if this is the right way but I tried to keep the change minimalistic.

const { exitCode } = await runBrowserTests({
root: './fixtures/isolate-and-setup-file',
})
expect(exitCode).toBe(0)
Copy link
Member

Choose a reason for hiding this comment

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

this needs a check similar to line 284 that confirms the file actually did run

Copy link
Contributor Author

@yjaaidi yjaaidi Oct 31, 2025

Choose a reason for hiding this comment

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

✅ done

Oh! I didn't notice the who instances settings. Good to know 😊
Btw, expect.soft sounds like a better fit for failure analysis here. (I mean in these kind of exitCode + outputs checks)

Copy link
Member

Choose a reason for hiding this comment

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

That's a good point. We usually keep the error check first instead of the exitCode for that reason

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👌

@sheremet-va sheremet-va merged commit f50ea7a into vitest-dev:main Oct 31, 2025
11 of 14 checks passed
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.

Setup files are not re-evaluated before each test file when disabling isolation in browser mode

2 participants