-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
toMatchInlineSnapshot confused on imported tests #484
Comments
I updated the example again, and it seems to fail if https://stackblitz.com/edit/node-h9ghpk?file=test/suite.test.ts |
vikunja-bot
pushed a commit
to go-vikunja/frontend
that referenced
this issue
Jan 10, 2022
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [vitest](https://github.com/vitest-dev/vitest) | devDependencies | patch | [`0.0.139` -> `0.0.140`](https://renovatebot.com/diffs/npm/vitest/0.0.139/0.0.140) | --- ### Release Notes <details> <summary>vitest-dev/vitest</summary> ### [`v0.0.140`](https://github.com/vitest-dev/vitest/releases/v0.0.140) [Compare Source](vitest-dev/vitest@v0.0.139...v0.0.140) ##### Bug Fixes - inline snapshot if not called inside suite ([6d743c5](vitest-dev/vitest@6d743c5)), closes [#​484](vitest-dev/vitest#484) - **ui:** flex / percentage based layout ([#​492](vitest-dev/vitest#492)) ([c43ebaf](vitest-dev/vitest@c43ebaf)) - correctly inline shapshot with properties ([4603ffd](vitest-dev/vitest@4603ffd)) - mocking is lost with threads: false ([28b97d8](vitest-dev/vitest@28b97d8)), closes [#​482](vitest-dev/vitest#482) - Reflect.get called on non-object ([3c9073a](vitest-dev/vitest@3c9073a)), closes [#​479](vitest-dev/vitest#479) - snapshot ignores indentation ([aff1481](vitest-dev/vitest@aff1481)) - **ui:** reduce graph container size ([#​478](vitest-dev/vitest#478)) ([23e1e62](vitest-dev/vitest@23e1e62)) ##### Features - global setup ([#​372](vitest-dev/vitest#372)) ([eaa119f](vitest-dev/vitest@eaa119f)) - **ui:** tasks state group ([7782e7d](vitest-dev/vitest@7782e7d)) </details> --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box. --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). Reviewed-on: https://kolaente.dev/vikunja/frontend/pulls/1348 Co-authored-by: renovate <[email protected]> Co-committed-by: renovate <[email protected]>
chaii3
pushed a commit
to chaii3/vitest
that referenced
this issue
May 13, 2022
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Describe the bug
If
toMatchInlineSnapshot
is used in an imported file, vitest gets confused. FortoMatchSnaphot
will instead be written to a snapshot named after the importing file.Use case: Have different tests e.g. for adapters (somthing like an API for web, websocket, filesystem, etc.). They should provide the same result for each adapter. Reusing the test result helps reducing code and separate adapter centric stuff from logic stuff.
It works in Jest.
Reproduction
https://stackblitz.com/edit/node-kg1mn9?file=test/suite.test.ts
Run
npm test
It will result in strange update.
external.ts
is not changed.System Info
Used Package Manager
pnpm
Validations
The text was updated successfully, but these errors were encountered: