mirror of
https://github.com/vuejs/vue-cli.git
synced 2026-05-12 14:58:26 -05:00
test: fix generator tests after babel config change
This commit is contained in:
@@ -44,7 +44,7 @@ test('classComponent', async () => {
|
||||
})
|
||||
|
||||
test('use with Babel', async () => {
|
||||
const { pkg, files } = await generateWithPlugin([
|
||||
const { files } = await generateWithPlugin([
|
||||
{
|
||||
id: 'babel',
|
||||
apply: require('@vue/cli-plugin-babel/generator'),
|
||||
@@ -59,7 +59,7 @@ test('use with Babel', async () => {
|
||||
}
|
||||
])
|
||||
|
||||
expect(pkg.babel).toEqual({ presets: ['@vue/app'] })
|
||||
expect(files['babel.config.js']).toMatch(`presets: [\n '@vue/app'\n ]`)
|
||||
expect(files['tsconfig.json']).toMatch(`"target": "esnext"`)
|
||||
})
|
||||
|
||||
|
||||
@@ -463,10 +463,9 @@ test('extract config files', async () => {
|
||||
extractConfigFiles: true
|
||||
})
|
||||
|
||||
const json = v => JSON.stringify(v, null, 2)
|
||||
const js = v => `module.exports = ${stringifyJS(v, null, 2)}`
|
||||
expect(fs.readFileSync('/vue.config.js', 'utf-8')).toMatch(js(configs.vue))
|
||||
expect(fs.readFileSync('/.babelrc', 'utf-8')).toMatch(json(configs.babel))
|
||||
expect(fs.readFileSync('/babel.config.js', 'utf-8')).toMatch(js(configs.babel))
|
||||
expect(fs.readFileSync('/.postcssrc.js', 'utf-8')).toMatch(js(configs.postcss))
|
||||
expect(fs.readFileSync('/.eslintrc.js', 'utf-8')).toMatch(js(configs.eslintConfig))
|
||||
expect(fs.readFileSync('/jest.config.js', 'utf-8')).toMatch(js(configs.jest))
|
||||
|
||||
Reference in New Issue
Block a user