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

Jest tests fail at importing vue-async-computed-decorator #12

Open
Threnos opened this issue May 22, 2020 · 4 comments
Open

Jest tests fail at importing vue-async-computed-decorator #12

Threnos opened this issue May 22, 2020 · 4 comments

Comments

@Threnos
Copy link

Threnos commented May 22, 2020

Hello.
I have a project, that has Vue and Jest written in typescript.
Encountered an issue, that Jest fails with Cannot find module 'vue-async-computed-decorator'. I am relatively new to unit testing and can't figure out if this is my fault with Jest configuration, or something wrong with computed-decorator.

Set up a reproduction repo for this case:
https://github.com/Threnos/jest-vue-test-utils-vue-async-computed-decorator

Steps for reproduction:
Clone the repo and run test:unit.

@frck006
Copy link

frck006 commented Oct 22, 2020

Did you find a solution ?

@Threnos
Copy link
Author

Threnos commented Oct 27, 2020

@frck006 Unfortunately, no. Checked once more - problem still persists with all packages up to date. Since I posted this issue, I stopped doing unit tests in hopes that this issue will be resolved.

@thekarinka
Copy link

My workaround is adding to jest.config.js to moduleNameMapper this line
'vue-async-computed-decorator': '<rootDir>/node_modules/vue-async-computed-decorator/dist/index.js'

@Blindpupil
Copy link

My workaround is adding to jest.config.js to moduleNameMapper this line
'vue-async-computed-decorator': '<rootDir>/node_modules/vue-async-computed-decorator/dist/index.js'

This, along with const localVue = createLocalVue(); localVue.use(AsyncComputed); in the wrapper fixed my issue. Thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants