-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
fix: normalize moduleCache
path
#1740
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a test for this?
ok. I will do it later. |
Thanks for this @ChpShy. |
I'm confused that I can't reproduce this in |
It looks like it is caused by But in demo project, test failed, because And |
Also, this maybe caused by vite. I'm not sure. Maybe someone can help to provide a reason? Hope for feedback~ |
I also test the different version of |
You can add a unit test: const mockMap = {
...your mocks
}
const mocker = new Mocker({ ...options })
const result = mocker.request(pathThatFailedBefore) |
I think this had been solved by pr #1726 line: https://github.com/vitest-dev/vitest/blob/main/packages/vitest/src/runtime/mocker.ts#L298 Waiting for release~ |
fix: #1714
This problem is caused by the
moduleCache
key is not same in setup file and the vue component.In setup file, the key is
/@fs/user/../node_modules/vue-meta/dist/vue-meta.cjs.js
, but in the component, is/node_modules/vue-meta/dist/vue-meta.cjs.js
.I'm not sure if this solution is the best, if not, modifications or rewrites are welcome~