Skip to content

Commit 37b3d49

Browse files
committed
fix depenedncy injection test
1 parent bf7d225 commit 37b3d49

File tree

4 files changed

+13
-5
lines changed

4 files changed

+13
-5
lines changed

test/fixtures/inject.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
window.injector = require('!!vue?inject!./inject.vue')
1+
window.injector = require('!!../../lib/loader?inject!./inject.vue')

test/fixtures/inject.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
</template>
44

55
<script>
6-
import SomeService from '../service'
6+
import SomeService from './service'
77
88
export default {
99
data () {

test/fixtures/service.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
msg: 'hi'
3+
}

test/test.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,13 @@ describe('vue-loader', function () {
4141

4242
function test (options, assert) {
4343
var config = Object.assign({}, globalConfig, options)
44-
webpack(config, function (err) {
45-
if (err) throw err
44+
webpack(config, function (err, stats) {
45+
if (stats.compilation.errors.length) {
46+
stats.compilation.errors.forEach(function (err) {
47+
console.error(err.message)
48+
})
49+
}
50+
expect(stats.compilation.errors).to.be.empty
4651
getFile('test.build.js', function (data) {
4752
jsdom.env({
4853
html: testHTML,
@@ -221,7 +226,7 @@ describe('vue-loader', function () {
221226
entry: './test/fixtures/inject.js'
222227
}, function (window) {
223228
var module = window.injector({
224-
'../service': {
229+
'./service': {
225230
msg: 'Hello from mocked service!'
226231
}
227232
})

0 commit comments

Comments
 (0)