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
Build: Migrate unit tests from Jest to Vitest #24415
Commits on Sep 14, 2023
-
-
-
-
-
-
-
-
-
-
-
-
Merge branch 'norbert/vitest-for-monorepo' of github.com:storybookjs/…
…storybook into norbert/vitest-for-monorepo
-
-
-
Commits on Sep 15, 2023
Commits on Sep 18, 2023
Commits on Oct 9, 2023
Commits on Oct 10, 2023
-
-
We could create a render helper which does this automatically, perhaps, but this seems clean enough, and there's only a handful of usages.
-
Previously vitest was also bringing in vite 5 beta, which screwed up the types
-
-
-
-
-
-
-
-
-
-
-
Use
import()
for presets instead ofinteropRequireDefault
vitest cannot mock `require` calls, but it can handle dynamic imports quite nicely. Since we require node 16+, I _think_ this is safe, but it will need to be confirmed.
-
-
If we're only using the @storyboook/globals package to help with testing, we might be able to remove it now, as vitest can handle global mocks quite well.
Commits on Oct 11, 2023
-
-
Avoid infinite loop in find-up
When we muck with process.cwd(), find-up can easily go into an infinite loop. Since we don't care about finding .git folders and such in this test, we can just mock out the `getProjectRoot` to return the (fake) cwd.
-
-
-
-
-
-
-
-
-
Commits on Nov 4, 2023
Commits on Nov 7, 2023
Commits on Nov 8, 2023
Commits on Nov 9, 2023
Commits on Nov 20, 2023
-
Merge remote-tracking branch 'origin/next' into norbert/vitest-for-mo…
…norepo # Conflicts: # MIGRATION.md # code/addons/a11y/package.json # code/addons/actions/package.json # code/addons/backgrounds/package.json # code/addons/interactions/package.json # code/addons/jest/package.json # code/addons/measure/package.json # code/addons/outline/package.json # code/addons/storyshots-core/package.json # code/addons/storyshots-puppeteer/package.json # code/addons/storysource/package.json # code/addons/themes/package.json # code/addons/toolbars/package.json # code/addons/viewport/package.json # code/builders/builder-vite/src/optimizeDeps.ts # code/deprecated/addons/package.json # code/deprecated/channel-postmessage/package.json # code/deprecated/channel-websocket/package.json # code/deprecated/client-api/package.json # code/deprecated/core-client/package.json # code/deprecated/manager-api-shim/package.json # code/deprecated/preview-web/package.json # code/deprecated/store/package.json # code/frameworks/nextjs/src/routing/app-router-provider.tsx # code/frameworks/nextjs/src/routing/page-router-provider.tsx # code/jest.config.js # code/lib/cli/package.json # code/lib/cli/scripts/generate-sb-packages-versions.js # code/lib/cli/src/versions.ts # code/lib/docs-tools/package.json # code/lib/manager-api/package.json # code/lib/preview-api/package.json # code/lib/preview/package.json # code/lib/preview/src/globals/globals.ts # code/lib/preview/src/globals/runtime.ts # code/package.json # code/ui/manager/src/globals/runtime.ts # code/ui/manager/src/globals/types.ts # code/ui/manager/src/runtime.ts # code/ui/manager/src/typings.d.ts # code/yarn.lock # docs/essentials/actions.md # docs/essentials/interactions.md # docs/writing-tests/snapshot-testing.md # scripts/package.json # scripts/prepare/bundle.ts # scripts/prepare/check-scripts.ts # scripts/prepare/check.ts # scripts/prepare/esm-bundle.ts # scripts/prepare/tsc.ts # scripts/release/__tests__/version.test.ts # scripts/tsconfig.json # scripts/yarn.lock
-
-
Commits on Nov 24, 2023
Commits on Dec 5, 2023
-
Merge remote-tracking branch 'origin/next' into norbert/vitest-for-mo…
…norepo # Conflicts: # code/lib/cli/src/automigrate/fixes/__snapshots__/angular-builders.test.ts.snap # code/lib/cli/src/automigrate/fixes/add-react.test.ts # code/lib/cli/src/automigrate/fixes/autodocs-true.test.ts # code/lib/cli/src/automigrate/fixes/builder-vite.test.ts # code/lib/cli/src/automigrate/fixes/cra5.test.ts # code/lib/cli/src/automigrate/helpers/checkWebpack5Builder.test.ts # code/lib/cli/tsconfig.json # code/lib/manager-api/src/tests/refs.test.ts # code/lib/postinstall/package.json # code/lib/preview-api/src/modules/client-api/ClientApi.test.ts # code/lib/preview-api/src/modules/core-client/start.test.ts # code/lib/source-loader/package.json # code/package.json # code/presets/server-webpack/package.json # code/renderers/react/src/public-api.test.ts # code/renderers/vue/package.json # code/renderers/vue3/template/cli/ts-4-9/Page.stories.ts # code/yarn.lock # scripts/yarn.lock
-
-
-
-
-
-
-
-
Snapshot indentation issues until vitest-dev/vitest#4663 is released
-
-
-
-