mirror of
https://github.com/vuejs/vue-cli.git
synced 2026-04-22 04:18:33 -05:00
69ebd800a2
BREAKING CHANGE: `cli-plugin-unit-jest` and `cli-plugin-unit-mocha` now register "test:unit" command and script instead of "test"; `cli-plugin-e2e-cypress` now register "test:e2e" with optional `--headless` flag instead of "e2e" and "e2e:open"; `cli-plugin-e2e-nightwatch` now register "test:e2e" instead of "e2e". close #876, close #878
26 lines
747 B
JavaScript
26 lines
747 B
JavaScript
const generateWithPlugin = require('@vue/cli-test-utils/generateWithPlugin')
|
|
|
|
test('base', async () => {
|
|
const { pkg, files } = await generateWithPlugin([
|
|
{
|
|
id: 'unit-jest',
|
|
apply: require('../generator'),
|
|
options: {}
|
|
},
|
|
// mock presence of the eslint plugin
|
|
{
|
|
id: 'eslint',
|
|
apply: () => {},
|
|
options: {}
|
|
}
|
|
])
|
|
|
|
expect(pkg.scripts['test:unit']).toBe('vue-cli-service test:unit')
|
|
expect(pkg.devDependencies).toHaveProperty('@vue/test-utils')
|
|
expect(pkg.devDependencies).toHaveProperty('babel-jest')
|
|
expect(files['tests/unit/.eslintrc.js']).toMatch('jest: true')
|
|
|
|
const spec = files['tests/unit/HelloWorld.spec.js']
|
|
expect(spec).toMatch(`expect(wrapper.text()).toMatch(msg)`)
|
|
})
|