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

Revert "fix: re-apply default conditions if using vite 6 or later (#7071)" #7271

Merged
merged 1 commit into from
Jan 16, 2025

Conversation

sheremet-va
Copy link
Member

This reverts commit 84287fc.

Description

Seems like this change cause too many unexpected issue that we didn't caught with our test suite.

Closes #7268
Closes #7269
Closes #7270
Closes #7266

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.

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:.

Copy link

netlify bot commented Jan 16, 2025

Deploy Preview for vitest-dev ready!

Name Link
🔨 Latest commit 4fa349b
🔍 Latest deploy log https://app.netlify.com/sites/vitest-dev/deploys/67895ab935128e00087a5eb1
😎 Deploy Preview https://deploy-preview-7271--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 site configuration.

@sheremet-va sheremet-va merged commit 755ecdf into vitest-dev:main Jan 16, 2025
13 checks passed
@sheremet-va sheremet-va deleted the revert/conditions-override branch January 16, 2025 19:30
@kolorfilm
Copy link

kolorfilm commented Jan 16, 2025

Hi there,

with 6.0 my tests are successful. With this change my tests are failing. It doesn't find many properties, for instance:

Cannot read properties of undefined (reading '100')

I do not unterstand why this change was reverted here.

@sheremet-va
Copy link
Member Author

Hi there,

with 6.0 my tests are successful. With this change my tests are failing. It doesn't find many properties, for instance:

Cannot read properties of undefined (reading '100')

I do not unterstand why this change was reverted here.

My vite (including vitest) config looks like that:


import react from '@vitejs/plugin-react-swc';

import { defineConfig as defineViteConfig, loadEnv, mergeConfig } from 'vite';

import mkcert from 'vite-plugin-mkcert';

import svgr from 'vite-plugin-svgr';

import { defineConfig as defineVitestConfig } from 'vitest/config';



const vitestConfig = defineVitestConfig({

  test: {

    setupFiles: './src/setupTests.ts',

    globals: true,

    environment: 'jsdom',

    mockReset: true,

  },

});



export default defineViteConfig(({ command, mode }) => {

  const env = loadEnv(mode, process.cwd(), 'VITE_');

  const isHttpsEnabled = env.VITE_ENABLE_HTTPS === 'true';



  const viteConfig = {

    server: {

      port: 3000,

      open: true,

      host: true,

    },

    plugins: [

      react(),

      svgr({

        svgrOptions: {

          exportType: 'default',

          ref: true,

          svgo: false,

          titleProp: true,

        },

        include: '**/*.svg',

      }),

      ...(command === 'serve' && isHttpsEnabled ? [mkcert()] : []),

    ],

  };



  return mergeConfig(viteConfig, vitestConfig);

});

Please, don't leave comments in closed prs. If you have a problem, create a new issue with a reproduction link.

renovate bot added a commit to mmkal/eslint-plugin-mmkal that referenced this pull request Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants