fix(typescript): tsconfig whitespace (#2046)

This commit is contained in:
ky-is
2018-08-03 10:52:18 -10:00
committed by Evan You
parent b20f624c32
commit 437f56cf99
2 changed files with 10 additions and 4 deletions

View File

@@ -110,10 +110,11 @@ test('tsconfig.json should be valid json', async () => {
expect(() => {
JSON.parse(files['tsconfig.json'])
}).not.toThrow()
expect(files['tsconfig.json']).not.toMatch('" ')
})
test('compat with unit-mocha', async () => {
const { pkg } = await generateWithPlugin([
const { pkg, files } = await generateWithPlugin([
{
id: '@vue/cli-plugin-unit-mocha',
apply: require('@vue/cli-plugin-unit-mocha/generator'),
@@ -131,10 +132,12 @@ test('compat with unit-mocha', async () => {
expect(pkg.devDependencies).toHaveProperty('@types/mocha')
expect(pkg.devDependencies).toHaveProperty('@types/chai')
expect(files['tsconfig.json']).not.toMatch('" ')
})
test('compat with unit-jest', async () => {
const { pkg } = await generateWithPlugin([
const { pkg, files } = await generateWithPlugin([
{
id: '@vue/cli-plugin-unit-jest',
apply: require('@vue/cli-plugin-unit-jest/generator'),
@@ -151,4 +154,6 @@ test('compat with unit-jest', async () => {
])
expect(pkg.devDependencies).toHaveProperty('@types/jest')
expect(files['tsconfig.json']).not.toMatch('" ')
})

View File

@@ -14,10 +14,11 @@
"sourceMap": true,
"baseUrl": ".",
"types": [
"node"<%_ if (hasMocha) { _%>,
"node"<% if (hasMocha || hasJest) { %>,<% } %>
<%_ if (hasMocha) { _%>
"mocha",
"chai"
<%_ } else if (hasJest) { _%>,
<%_ } else if (hasJest) { _%>
"jest"
<%_ } _%>
],