Commit d14203e6 authored by Evan You's avatar Evan You

test: fix tests on Windows

parent 0766fe71
...@@ -65,11 +65,11 @@ module.exports = function (source) { ...@@ -65,11 +65,11 @@ module.exports = function (source) {
} }
// module id for scoped CSS & hot-reload // module id for scoped CSS & hot-reload
const shortFilePath = path const rawShortFilePath = path
.relative(context, resourcePath) .relative(context, resourcePath)
.replace(/\\/g, '/') .replace(/^(\.\.[\/\\])+/, '')
.replace(/^(\.\.\/)+/, '') +
resourceQuery const shortFilePath = rawShortFilePath.replace(/\\/g, '/') + resourceQuery
const id = hash( const id = hash(
isProduction isProduction
...@@ -161,7 +161,7 @@ var component = normalizer( ...@@ -161,7 +161,7 @@ var component = normalizer(
// Expose filename. This is used by the devtools and vue runtime warnings. // Expose filename. This is used by the devtools and vue runtime warnings.
if (!isProduction) { if (!isProduction) {
code += `\ncomponent.options.__file = ${JSON.stringify(shortFilePath)}` code += `\ncomponent.options.__file = ${JSON.stringify(rawShortFilePath)}`
} }
code += `\nexport default component.exports` code += `\nexport default component.exports`
......
...@@ -43,7 +43,7 @@ const baseConfig = { ...@@ -43,7 +43,7 @@ const baseConfig = {
} }
function genId (file) { function genId (file) {
return hash(path.join('test', 'fixtures', file)) return hash(path.join('test', 'fixtures', file).replace(/\\/g, '/'))
} }
function bundle (options, cb, wontThrowError) { function bundle (options, cb, wontThrowError) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment