Skip to content

Commit 82a9f90

Browse files
committed
disable building windows on linux tests
1 parent 98e4592 commit 82a9f90

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

__tests__/build.helper.js

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@ const runTests = useTS =>
99
new Promise(async resolve => {
1010
const { project, projectName } = await create('build', useTS)
1111

12+
const isWin = process.platform === 'win32'
1213
const projectPath = p =>
1314
path.join(process.cwd(), '__tests__/projects/' + projectName, p)
1415

1516
const { stdout } = await project.run(
16-
'vue-cli-service build:electron --x64 --win zip --linux zip'
17+
`vue-cli-service build:electron ${isWin ? '--win zip' : ''} --linux zip`
1718
)
1819
// Ensure built completes
1920
expect(stdout.indexOf('Build complete!')).not.toBe(-1)
@@ -25,9 +26,11 @@ const runTests = useTS =>
2526
expect(project.has('dist_electron/bundled/js')).toBe(true)
2627
expect(project.has('dist_electron/bundled/css')).toBe(true)
2728
expect(project.has('dist_electron/bundled/background.js')).toBe(true)
28-
expect(project.has(`dist_electron/win-unpacked/${projectName}.exe`)).toBe(
29-
true
30-
)
29+
if (isWin) {
30+
expect(project.has(`dist_electron/win-unpacked/${projectName}.exe`)).toBe(
31+
true
32+
)
33+
}
3134
expect(project.has(`dist_electron/linux-unpacked/${projectName}`)).toBe(
3235
true
3336
)
@@ -36,7 +39,11 @@ const runTests = useTS =>
3639
false
3740
)
3841
// Ensure that zip files were created
39-
expect(project.has(`dist_electron/${projectName}-0.1.0-win.zip`)).toBe(true)
42+
if (isWin) {
43+
expect(project.has(`dist_electron/${projectName}-0.1.0-win.zip`)).toBe(
44+
true
45+
)
46+
}
4047
expect(project.has(`dist_electron/${projectName}-0.1.0.zip`)).toBe(true)
4148
// Ensure base is set properly (for app protocol)
4249
const index = fs.readFileSync(
@@ -45,7 +52,6 @@ const runTests = useTS =>
4552
)
4653
expect(index.indexOf('<base href=app://./ >')).not.toBe(-1)
4754
// Launch app with spectron
48-
const isWin = process.platform === 'win32'
4955
const app = new Application({
5056
path: `./__tests__/projects/${projectName}/dist_electron/${
5157
isWin ? 'win' : 'linux'

0 commit comments

Comments
 (0)