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

Build: Migrate unit tests from Jest to Vitest #24415

Merged
merged 116 commits into from Dec 20, 2023
Merged

Commits on Sep 14, 2023

  1. Copy the full SHA
    8c7f376 View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    be2bf24 View commit details
    Browse the repository at this point in the history
  3. Copy the full SHA
    b911c4d View commit details
    Browse the repository at this point in the history
  4. run tests only once

    ndelangen committed Sep 14, 2023
    Copy the full SHA
    ed23b2e View commit details
    Browse the repository at this point in the history
  5. migrate some things by hand

    ndelangen committed Sep 14, 2023
    Copy the full SHA
    aacc4ac View commit details
    Browse the repository at this point in the history
  6. more manual migrations

    ndelangen committed Sep 14, 2023
    Copy the full SHA
    93db551 View commit details
    Browse the repository at this point in the history
  7. Copy the full SHA
    fd0386f View commit details
    Browse the repository at this point in the history
  8. Copy the full SHA
    1dfe687 View commit details
    Browse the repository at this point in the history
  9. update snapshots

    yannbf committed Sep 14, 2023
    Copy the full SHA
    799b7c7 View commit details
    Browse the repository at this point in the history
  10. more fixes

    yannbf committed Sep 14, 2023
    Copy the full SHA
    d91a91e View commit details
    Browse the repository at this point in the history
  11. progress on fixes

    ndelangen committed Sep 14, 2023
    Copy the full SHA
    604a442 View commit details
    Browse the repository at this point in the history
  12. Merge branch 'norbert/vitest-for-monorepo' of github.com:storybookjs/…

    …storybook into norbert/vitest-for-monorepo
    ndelangen committed Sep 14, 2023
    Copy the full SHA
    4eace09 View commit details
    Browse the repository at this point in the history
  13. fixing tests in scripts

    ndelangen committed Sep 14, 2023
    Copy the full SHA
    c9f36de View commit details
    Browse the repository at this point in the history
  14. Copy the full SHA
    90d5409 View commit details
    Browse the repository at this point in the history
  15. fix imports

    yannbf committed Sep 14, 2023
    Copy the full SHA
    d1966b1 View commit details
    Browse the repository at this point in the history

Commits on Sep 15, 2023

  1. more test fixes

    yannbf committed Sep 15, 2023
    Copy the full SHA
    cb9ffb1 View commit details
    Browse the repository at this point in the history
  2. fix more tests

    yannbf committed Sep 15, 2023
    Copy the full SHA
    c43385b View commit details
    Browse the repository at this point in the history
  3. more fixes

    yannbf committed Sep 15, 2023
    Copy the full SHA
    6c272c9 View commit details
    Browse the repository at this point in the history
  4. fix codemods test

    ndelangen committed Sep 15, 2023
    Copy the full SHA
    6250ef3 View commit details
    Browse the repository at this point in the history
  5. improve test

    ndelangen committed Sep 15, 2023
    Copy the full SHA
    ab77c3e View commit details
    Browse the repository at this point in the history
  6. fix a test

    ndelangen committed Sep 15, 2023
    Copy the full SHA
    2ae51af View commit details
    Browse the repository at this point in the history

Commits on Sep 18, 2023

  1. remove jest-os-detection

    yannbf committed Sep 18, 2023
    Copy the full SHA
    70beaf7 View commit details
    Browse the repository at this point in the history

Commits on Oct 9, 2023

  1. Copy the full SHA
    5d73a0a View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    9a2f8f6 View commit details
    Browse the repository at this point in the history
  3. Copy the full SHA
    b76d42c View commit details
    Browse the repository at this point in the history

Commits on Oct 10, 2023

  1. Add/configure jest-dom

    IanVS committed Oct 10, 2023
    Copy the full SHA
    75e7d00 View commit details
    Browse the repository at this point in the history
  2. Cleanup after rendering

    We could create a render helper which does this automatically, perhaps,
    but this seems clean enough, and there's only a handful of usages.
    IanVS committed Oct 10, 2023
    Copy the full SHA
    db243e1 View commit details
    Browse the repository at this point in the history
  3. Only use vite 4

    Previously vitest was also bringing in vite 5 beta,
    which screwed up the types
    IanVS committed Oct 10, 2023
    Copy the full SHA
    ccff556 View commit details
    Browse the repository at this point in the history
  4. Get renderers/vue tests passing

    IanVS committed Oct 10, 2023
    Copy the full SHA
    5fe8e5b View commit details
    Browse the repository at this point in the history
  5. Copy the full SHA
    2ca45f5 View commit details
    Browse the repository at this point in the history
  6. Copy the full SHA
    ca0394d View commit details
    Browse the repository at this point in the history
  7. Fix cli helpers test

    IanVS committed Oct 10, 2023
    Copy the full SHA
    00b0f0e View commit details
    Browse the repository at this point in the history
  8. Copy the full SHA
    238f254 View commit details
    Browse the repository at this point in the history
  9. Fix type error

    IanVS committed Oct 10, 2023
    Copy the full SHA
    5652c32 View commit details
    Browse the repository at this point in the history
  10. Avoid empty mockImplementation

    IanVS committed Oct 10, 2023
    Copy the full SHA
    8abefdb View commit details
    Browse the repository at this point in the history
  11. Copy the full SHA
    af7e7e4 View commit details
    Browse the repository at this point in the history
  12. Avoid console warning error

    IanVS committed Oct 10, 2023
    Copy the full SHA
    a53cf8d View commit details
    Browse the repository at this point in the history
  13. Fix lib/codemod test

    IanVS committed Oct 10, 2023
    Copy the full SHA
    7634e80 View commit details
    Browse the repository at this point in the history
  14. Use import() for presets instead of interopRequireDefault

    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.
    IanVS committed Oct 10, 2023
    Copy the full SHA
    397cafe View commit details
    Browse the repository at this point in the history
  15. Copy the full SHA
    f70813d View commit details
    Browse the repository at this point in the history
  16. Get lib/theming tests passing

    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.
    IanVS committed Oct 10, 2023
    Copy the full SHA
    fd15923 View commit details
    Browse the repository at this point in the history

Commits on Oct 11, 2023

  1. Update snapshot format

    IanVS committed Oct 11, 2023
    Copy the full SHA
    d2f4af1 View commit details
    Browse the repository at this point in the history
  2. 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.
    IanVS committed Oct 11, 2023
    Copy the full SHA
    6d35099 View commit details
    Browse the repository at this point in the history
  3. Copy the full SHA
    375fe3d View commit details
    Browse the repository at this point in the history
  4. Copy the full SHA
    2373a09 View commit details
    Browse the repository at this point in the history
  5. Copy the full SHA
    29d3e7c View commit details
    Browse the repository at this point in the history
  6. Copy the full SHA
    ae00f52 View commit details
    Browse the repository at this point in the history
  7. Copy the full SHA
    3c2479f View commit details
    Browse the repository at this point in the history
  8. Copy the full SHA
    4ddebe8 View commit details
    Browse the repository at this point in the history
  9. Remove some unused code

    IanVS committed Oct 11, 2023
    Copy the full SHA
    1da8527 View commit details
    Browse the repository at this point in the history
  10. Copy the full SHA
    3f5e0f3 View commit details
    Browse the repository at this point in the history
  11. Copy the full SHA
    aab2798 View commit details
    Browse the repository at this point in the history

Commits on Nov 4, 2023

  1. add ignore

    ndelangen committed Nov 4, 2023
    Copy the full SHA
    1e8adfd View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    99ad313 View commit details
    Browse the repository at this point in the history
  3. ts fixes

    ndelangen committed Nov 4, 2023
    Copy the full SHA
    360d02d View commit details
    Browse the repository at this point in the history
  4. Copy the full SHA
    bfe4397 View commit details
    Browse the repository at this point in the history
  5. update snapshots && fixes

    ndelangen committed Nov 4, 2023
    Copy the full SHA
    458227a View commit details
    Browse the repository at this point in the history
  6. fixes

    ndelangen committed Nov 4, 2023
    Copy the full SHA
    4572eeb View commit details
    Browse the repository at this point in the history

Commits on Nov 7, 2023

  1. Copy the full SHA
    e65f677 View commit details
    Browse the repository at this point in the history

Commits on Nov 8, 2023

  1. fix linting

    ndelangen committed Nov 8, 2023
    Copy the full SHA
    1c9050a View commit details
    Browse the repository at this point in the history
  2. fix check

    ndelangen committed Nov 8, 2023
    Copy the full SHA
    44944d4 View commit details
    Browse the repository at this point in the history
  3. fix check of scripts

    ndelangen committed Nov 8, 2023
    Copy the full SHA
    a5d5e8e View commit details
    Browse the repository at this point in the history
  4. remove invalid flags

    ndelangen committed Nov 8, 2023
    Copy the full SHA
    e3de0b5 View commit details
    Browse the repository at this point in the history
  5. remove --ci flags

    ndelangen committed Nov 8, 2023
    Copy the full SHA
    3a2986e View commit details
    Browse the repository at this point in the history
  6. Copy the full SHA
    6f53f7a View commit details
    Browse the repository at this point in the history

Commits on Nov 9, 2023

  1. add package

    ndelangen committed Nov 9, 2023
    Copy the full SHA
    9adfc24 View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    0452176 View commit details
    Browse the repository at this point in the history
  3. Copy the full SHA
    b64d62b View commit details
    Browse the repository at this point in the history

Commits on Nov 20, 2023

  1. 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
    IanVS committed Nov 20, 2023
    Copy the full SHA
    8e533c2 View commit details
    Browse the repository at this point in the history
  2. Update snapshot

    IanVS committed Nov 20, 2023
    Copy the full SHA
    3710197 View commit details
    Browse the repository at this point in the history
  3. Update globals

    IanVS committed Nov 20, 2023
    Copy the full SHA
    39f3e42 View commit details
    Browse the repository at this point in the history

Commits on Nov 24, 2023

  1. fix more tests

    yannbf committed Nov 24, 2023
    Copy the full SHA
    ee0953d View commit details
    Browse the repository at this point in the history

Commits on Dec 5, 2023

  1. 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
    IanVS committed Dec 5, 2023
    Copy the full SHA
    360ba46 View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    3e2f4be View commit details
    Browse the repository at this point in the history
  3. Copy the full SHA
    7ddbde1 View commit details
    Browse the repository at this point in the history
  4. Fix eslint test

    IanVS committed Dec 5, 2023
    Copy the full SHA
    513a02f View commit details
    Browse the repository at this point in the history
  5. Update exports

    IanVS committed Dec 5, 2023
    Copy the full SHA
    dcabfe6 View commit details
    Browse the repository at this point in the history
  6. Fix lockfile

    IanVS committed Dec 5, 2023
    Copy the full SHA
    5a6b178 View commit details
    Browse the repository at this point in the history
  7. Fix lint errors

    IanVS committed Dec 5, 2023
    Copy the full SHA
    6ce478c View commit details
    Browse the repository at this point in the history
  8. Update vitest to 1.0.1

    IanVS committed Dec 5, 2023
    Copy the full SHA
    0845820 View commit details
    Browse the repository at this point in the history
  9. Fix scripts tests

    Snapshot indentation issues until vitest-dev/vitest#4663 is released
    IanVS committed Dec 5, 2023
    Copy the full SHA
    56c0710 View commit details
    Browse the repository at this point in the history
  10. Update snapshots

    IanVS committed Dec 5, 2023
    Copy the full SHA
    f368ac4 View commit details
    Browse the repository at this point in the history
  11. Unpin vite

    IanVS committed Dec 5, 2023
    Copy the full SHA
    20ccf0b View commit details
    Browse the repository at this point in the history
  12. Fix type errors

    IanVS committed Dec 5, 2023
    Copy the full SHA
    3fbe517 View commit details
    Browse the repository at this point in the history
  13. Copy the full SHA
    7df71d3 View commit details
    Browse the repository at this point in the history

Commits on Dec 6, 2023

  1. Copy the full SHA
    ee78f8e View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    6dfcad5 View commit details
    Browse the repository at this point in the history
  3. Copy the full SHA
    7d671ee View commit details
    Browse the repository at this point in the history
  4. Copy the full SHA
    239a67d View commit details
    Browse the repository at this point in the history
  5. increase timeout

    JReinhold committed Dec 6, 2023
    Copy the full SHA
    e95b906 View commit details
    Browse the repository at this point in the history

Commits on Dec 7, 2023

  1. Fix changelog test

    kasperpeulen committed Dec 7, 2023
    Copy the full SHA
    019a19f View commit details
    Browse the repository at this point in the history

Commits on Dec 11, 2023

  1. Copy the full SHA
    5b383c0 View commit details
    Browse the repository at this point in the history

Commits on Dec 12, 2023

  1. Copy the full SHA
    c16c125 View commit details
    Browse the repository at this point in the history
  2. Fix Angular tests

    valentinpalkovic committed Dec 12, 2023
    Copy the full SHA
    205a339 View commit details
    Browse the repository at this point in the history
  3. Fix eslint

    valentinpalkovic committed Dec 12, 2023
    Copy the full SHA
    eed6f38 View commit details
    Browse the repository at this point in the history
  4. Fix Svelte tests

    valentinpalkovic committed Dec 12, 2023
    Copy the full SHA
    2eaeb1f View commit details
    Browse the repository at this point in the history

Commits on Dec 14, 2023

  1. Fix test for Windows

    valentinpalkovic committed Dec 14, 2023
    Copy the full SHA
    ac864a8 View commit details
    Browse the repository at this point in the history

Commits on Dec 18, 2023

  1. fix types in compodoc tests

    yannbf committed Dec 18, 2023
    Copy the full SHA
    4f1931d View commit details
    Browse the repository at this point in the history
  2. remove unnecessary directories

    yannbf committed Dec 18, 2023
    Copy the full SHA
    27047ab View commit details
    Browse the repository at this point in the history
  3. remove jest leftovers

    yannbf committed Dec 18, 2023
    Copy the full SHA
    8acf97a View commit details
    Browse the repository at this point in the history
  4. temporarily debug windows test

    yannbf committed Dec 18, 2023
    Copy the full SHA
    5a20d19 View commit details
    Browse the repository at this point in the history
  5. undo function calls

    yannbf committed Dec 18, 2023
    Copy the full SHA
    3d61dc5 View commit details
    Browse the repository at this point in the history
  6. Copy the full SHA
    51ead4f View commit details
    Browse the repository at this point in the history

Commits on Dec 19, 2023

  1. Copy the full SHA
    93339af View commit details
    Browse the repository at this point in the history
  2. fix helper tests on windows

    yannbf committed Dec 19, 2023
    Copy the full SHA
    795fb55 View commit details
    Browse the repository at this point in the history
  3. Copy the full SHA
    7844a6e View commit details
    Browse the repository at this point in the history
  4. Copy the full SHA
    f62613c View commit details
    Browse the repository at this point in the history
  5. increase test timeout

    yannbf committed Dec 19, 2023
    Copy the full SHA
    10c614e View commit details
    Browse the repository at this point in the history
  6. Copy the full SHA
    6b61f37 View commit details
    Browse the repository at this point in the history
  7. undo debugging checks

    yannbf committed Dec 19, 2023
    Copy the full SHA
    4a32582 View commit details
    Browse the repository at this point in the history
  8. update misc code

    yannbf committed Dec 19, 2023
    Copy the full SHA
    62df129 View commit details
    Browse the repository at this point in the history
  9. undo svelte component changes

    yannbf committed Dec 19, 2023
    Copy the full SHA
    62348c0 View commit details
    Browse the repository at this point in the history
  10. fix types in normalize-stories

    yannbf committed Dec 19, 2023
    Copy the full SHA
    f07f64e View commit details
    Browse the repository at this point in the history
  11. final cleanup

    yannbf committed Dec 19, 2023
    Copy the full SHA
    469f49c View commit details
    Browse the repository at this point in the history
  12. update contribution guide

    yannbf committed Dec 19, 2023
    Copy the full SHA
    9508756 View commit details
    Browse the repository at this point in the history
  13. fix typo

    yannbf committed Dec 19, 2023
    Copy the full SHA
    2b1258a View commit details
    Browse the repository at this point in the history