Skip to content

Commit 46ffb4d

Browse files
committed
test: add a test case for vuejs/vue#12828
1 parent 94cfccf commit 46ffb4d

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

Diff for: test/template.spec.js

+37
Original file line numberDiff line numberDiff line change
@@ -340,3 +340,40 @@ test('postLoaders support', done => {
340340
done()
341341
})
342342
})
343+
344+
// https://github.com/vuejs/vue/issues/12828
345+
test('should skip thread-loader in the template compilation pipeline', done => {
346+
mockBundleAndRun({
347+
entry: 'custom-directive.vue',
348+
vue: {
349+
compilerOptions: {
350+
directives: {
351+
i18n (el, dir) {
352+
if (dir.name === 'i18n' && dir.value) {
353+
el.i18n = dir.value
354+
if (!el.props) {
355+
el.props = []
356+
}
357+
el.props.push({ name: 'textContent', value: `_s(${JSON.stringify(dir.value)})` })
358+
}
359+
}
360+
}
361+
}
362+
},
363+
module: {
364+
rules: [{
365+
test: /\.js$/,
366+
use: [{
367+
loader: 'thread-loader',
368+
options: {
369+
workers: 2
370+
}
371+
}]
372+
}]
373+
}
374+
}, ({ window, module }) => {
375+
const vnode = mockRender(module)
376+
expect(vnode.data.domProps.textContent).toBe('keypath')
377+
done()
378+
})
379+
})

0 commit comments

Comments
 (0)