-
Notifications
You must be signed in to change notification settings - Fork 157
Cannot find module from .vue file #130
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
Comments
vue-jest/lib/compilers/babel-compiler.js
|
@eddyerburgh Do you think #129 will help in my case? Do you know how to define an external module in vue-jest? In webpack (3.12.0) I do the following but not sure how that translate to jest/vue-jest. const HtmlWebpackExternalsPlugin = require('html-webpack-externals-plugin')
// https://github.com/JeffreyWay/laravel-mix/blob/master/docs/quick-webpack-configuration.md
mix.webpackConfig(webpack => {
return {
plugins: [
new HtmlWebpackExternalsPlugin({
externals: [
{
module: 'PSPDFKit',
entry: process.env.SIESTA_WEBVIEWER_ENGINE_URL + '/pspdfkit.js',
global: 'PSPDFKit'
}
]
})
]
}
}) |
No that PR won't solve this issue. You could use the Jest {
...
"jest": {
"globals": {
"PSPDFKit": { someMethod: () => {} }
}
}
} |
@dotnetCarpenter That's is what I am doing. package.json: globals": {
"PSPDFKit": {
"LayoutMode": {
"AUTO": "AUTO",
"SINGLE": "SINGLE",
"DOUBLE": "DOUBLE"
}
}
}, From original post Which I have confirmed using I've debugged vue-jest but can not see anywhere that vue-jest uses the @eddyerburgh How is it suppose to work? |
Hey, sorry for the slow reply. The globals option works as expected in master, which I will release as v4-beta today. |
@eddyerburgh Thanks. I will update and see if it fixes the issue |
@eddyerburgh I finally got around to try your the beta. |
I'm using an external global module, that seems to break vue-jest with the following error:
vue-jest: 3.0.0
jest: 23.6.0
vue-loader: 13.7.2
node: v8.12.0
In my package.json I have set the global, which works fine for all
.js
files but not.vue
files.package.json
I've tried to set "externals" in my
.babelrc
but to no avail..babelrc
In vue-jest/lib/process.js
jestConfig
has the"globals"
but not the"externals"
from .babelrc.vueJestConfig
is an empty object.npx jest --showConfig:
The text was updated successfully, but these errors were encountered: