Skip to content

Commit a3ccb7a

Browse files
authoredNov 6, 2022
Pretty stringify for test packages (#1876)
1 parent 90296e4 commit a3ccb7a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed
 

‎__tests__/commands.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ describe('electron:build', () => {
383383
external: '^0.0.1'
384384
}
385385
},
386-
undefined,
386+
null,
387387
2
388388
)
389389
)

‎__tests__/createProject.helper.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ const createProject = async (projectName, useTS, customPlugins = {}) => {
8080
fs.ensureDirSync(projectPath('node_modules/vue'))
8181
fs.writeFileSync(
8282
projectPath('node_modules/vue/package.json'),
83-
JSON.stringify(vuePkg)
83+
JSON.stringify(vuePkg, null, 2)
8484
)
8585

8686
// Add a fake package that should be an external
@@ -90,7 +90,7 @@ const createProject = async (projectName, useTS, customPlugins = {}) => {
9090
fs.ensureDirSync(projectPath('node_modules/mockExternal'))
9191
fs.writeFileSync(
9292
projectPath('node_modules/mockExternal/package.json'),
93-
JSON.stringify(externalPkg)
93+
JSON.stringify(externalPkg, null, 2)
9494
)
9595
// Add mockExternal to app's package.json so that it is detected as external
9696
const appPkg = JSON.parse(
@@ -99,7 +99,7 @@ const createProject = async (projectName, useTS, customPlugins = {}) => {
9999
appPkg.dependencies.mockExternal = 'mockExternal'
100100
// Enable nodeIntegration
101101
appPkg.vue.pluginOptions = { electronBuilder: { nodeIntegration: true } }
102-
fs.writeFileSync(projectPath('package.json'), JSON.stringify(appPkg))
102+
fs.writeFileSync(projectPath('package.json'), JSON.stringify(appPkg, null, 2))
103103

104104
return { project, projectName }
105105
}

0 commit comments

Comments
 (0)
Please sign in to comment.