Skip to content

Commit

Permalink
test: add a test case for vuejs/vue#12828
Browse files Browse the repository at this point in the history
  • Loading branch information
haoqunjiang committed Nov 14, 2022
1 parent 94cfccf commit 46ffb4d
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions test/template.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -340,3 +340,40 @@ test('postLoaders support', done => {
done()
})
})

// https://github.com/vuejs/vue/issues/12828
test('should skip thread-loader in the template compilation pipeline', done => {
mockBundleAndRun({
entry: 'custom-directive.vue',
vue: {
compilerOptions: {
directives: {
i18n (el, dir) {
if (dir.name === 'i18n' && dir.value) {
el.i18n = dir.value
if (!el.props) {
el.props = []
}
el.props.push({ name: 'textContent', value: `_s(${JSON.stringify(dir.value)})` })
}
}
}
}
},
module: {
rules: [{
test: /\.js$/,
use: [{
loader: 'thread-loader',
options: {
workers: 2
}
}]
}]
}
}, ({ window, module }) => {
const vnode = mockRender(module)
expect(vnode.data.domProps.textContent).toBe('keypath')
done()
})
})

0 comments on commit 46ffb4d

Please sign in to comment.