test: fix generator tests after babel config change

This commit is contained in:
test
2018-05-17 17:19:39 -04:00
parent a1ccde8c2e
commit 2de86cea70
2 changed files with 3 additions and 4 deletions
@@ -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))