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

🐛 Bug: Hidden breaking changes from 0.33 -> 0.34 #3948

Closed
6 tasks done
hinogi opened this issue Aug 14, 2023 · 4 comments · Fixed by #3957
Closed
6 tasks done

🐛 Bug: Hidden breaking changes from 0.33 -> 0.34 #3948

hinogi opened this issue Aug 14, 2023 · 4 comments · Fixed by #3957

Comments

@hinogi
Copy link

hinogi commented Aug 14, 2023

Describe the bug

Usage of files outside the projectfolder worked in 0.33 like require('path').resolve(somerootdir, 'somepath.ts') in setupFiles from a shared config for example. in 0.34 you may need to add { server: { fs: { strict: false }}} might be a result of updating defineConfig from vite?

Changing process.env.NODE_ENV for example did work in 0.33. In 0.34 you get an error that you cannot change rvalues.

Reproduction

https://stackblitz.com/fork/github/vitest-dev/vitest/tree/main/examples/basic?initialPath=__vitest__/

System Info

vitest 0.34

Used Package Manager

npm

Validations

@stackblitz
Copy link

stackblitz bot commented Aug 14, 2023

Fix this issue in StackBlitz Codeflow Start a new pull request in StackBlitz Codeflow.

@sheremet-va
Copy link
Member

These are not breaking changes, but bugs.

@abrowne2
Copy link

Experiencing issues with setupFiles between 0.33 -> 0.34

image

I cannot share further debug details because they are proprietary, but this .on issue is quite strange and does not happen in 0.33.

Test config;

  test: {
    includeSource: ['src/lib/**/*.ts', 'src/lib/**/*.js', 'src/lib/**/*.svelte', 'src/tests/*.test.ts'],
    setupFiles: [
      'src/tests/globalTestSetup.ts'
    ],
    hookTimeout: 25000
  },

My beforeAll function applies some global shared variables throughout all of my tests and calls a playwright page setup context function; there's no indication that's having issues in the new version (struggling here):

beforeAll(async () => {
    if (globalThis.processInProgress && !globalThis.context) {
        await waitUntilReady();
    }

    // ... omitted for brevity ...
});

@sheremet-va
Copy link
Member

Experiencing issues with setupFiles between 0.33 -> 0.34

This just looks like a version mismatch. Check that all @vitest/ packages use the same version in you lockfile.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants