@@ -9,11 +9,12 @@ const runTests = useTS =>
9
9
new Promise ( async resolve => {
10
10
const { project, projectName } = await create ( 'build' , useTS )
11
11
12
+ const isWin = process . platform === 'win32'
12
13
const projectPath = p =>
13
14
path . join ( process . cwd ( ) , '__tests__/projects/' + projectName , p )
14
15
15
16
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`
17
18
)
18
19
// Ensure built completes
19
20
expect ( stdout . indexOf ( 'Build complete!' ) ) . not . toBe ( - 1 )
@@ -25,9 +26,11 @@ const runTests = useTS =>
25
26
expect ( project . has ( 'dist_electron/bundled/js' ) ) . toBe ( true )
26
27
expect ( project . has ( 'dist_electron/bundled/css' ) ) . toBe ( true )
27
28
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
+ }
31
34
expect ( project . has ( `dist_electron/linux-unpacked/${ projectName } ` ) ) . toBe (
32
35
true
33
36
)
@@ -36,7 +39,11 @@ const runTests = useTS =>
36
39
false
37
40
)
38
41
// 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
+ }
40
47
expect ( project . has ( `dist_electron/${ projectName } -0.1.0.zip` ) ) . toBe ( true )
41
48
// Ensure base is set properly (for app protocol)
42
49
const index = fs . readFileSync (
@@ -45,7 +52,6 @@ const runTests = useTS =>
45
52
)
46
53
expect ( index . indexOf ( '<base href=app://./ >' ) ) . not . toBe ( - 1 )
47
54
// Launch app with spectron
48
- const isWin = process . platform === 'win32'
49
55
const app = new Application ( {
50
56
path : `./__tests__/projects/${ projectName } /dist_electron/${
51
57
isWin ? 'win' : 'linux'
0 commit comments