This repository was archived by the owner on Jan 19, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 64
This repository was archived by the owner on Jan 19, 2021. It is now read-only.
Error: Unable to lookup source #46
Copy link
Copy link
Closed
Description
I'm trying to get coverage tests for my vuejs project. My webpack2 rules look like this...
rules: [{
test: /\.js$/,
exclude: /node_modules|vue\/src|vue-router\//,
loader: 'babel-loader',
options: {
presets: [
['es2015', { 'modules': false }]
],
plugins: ['transform-runtime']
}
}, {
test: /\.styl$/,
loaders: ['style-loader', 'css-loader', 'stylus-loader']
}, {
test: /\.vue$/,
loader: 'vue-loader',
options: {
postLoaders: {
js: 'istanbul-instrumenter-loader?esModules=true'
}
}
}, {
include: /\.json$/,
loaders: ['json-loader']
}, {
enforce: 'post',
test: /\.js$/,
exclude: /node_modules|vue\/src|vue-router\/|test\//,
loader: 'istanbul-instrumenter-loader',
query: {
debug: true,
preserveComments: true,
esModules: true
}
}]
},
My karma config looks like this.
{
frameworks: ['jasmine'],
singleRun: true,
colors: true,
browsers: ['Chrome'],
phantomjsLauncher: {
exitOnResourceError: true
},
reporters: ['spec', 'coverage-istanbul'],
files: [
{ pattern: 'test/unit/**/*-spec.js', watched: false }
],
preprocessors: {
'test/unit/**/*-spec.js': ['webpack']
},
webpack: {
devtool: 'source-map',
output: {
},
module: webpack.module,
resolve: webpack.resolve
},
webpackMiddleware: {
noInfo: true,
stats: 'errors-only'
},
coverageIstanbulReporter: {
dir: './build/reports/unit',
reports: [ 'text-summary', 'html' ],
fixWebpackSourcePaths: true,
'report-options': {
html: {
verbose: true,
subdir: 'html'
}
}
}
},
specReporter: {
suppressSkipped: false
}
}
The istanbul-instrumenter-loader is used specifically for the javascript section of the .vue files as a postLoader. When I run karma I'm getting a report but its just an error Error: Unable to lookup source: /Users/user/Development/app/src/components/background.vue?094fc1b7(ENOENT: no such file or directory, open '/Users/user/Development/app/src/components/background.vue?094fc1b7')
, note the has on the end of the filename. Is there something I'm doing wrong?
divyanthj
Metadata
Metadata
Assignees
Labels
No labels