@@ -22,7 +22,9 @@ module.exports = async ({ client, projectPath, projectName, mode }) => {
22
22
// Remove any quotes
23
23
appBaseUrl = appBaseUrl . replace ( '"' , '' )
24
24
// Base url should be root of server or packaged asar
25
- expect ( appBaseUrl ) . toBe ( isBuild ? outputPath : '/' )
25
+ expect ( path . normalize ( appBaseUrl ) ) . toBe (
26
+ isBuild ? outputPath : path . sep /* Server root */
27
+ )
26
28
27
29
let appStatic = logs
28
30
// Find __static log
@@ -45,6 +47,8 @@ module.exports = async ({ client, projectPath, projectName, mode }) => {
45
47
modulePaths = modulePaths . replace ( / " $ / , '' )
46
48
// Parse modulePaths array
47
49
modulePaths = modulePaths . split ( ',' )
50
+ // Normalize paths
51
+ modulePaths = modulePaths . map ( p => path . normalize ( p ) )
48
52
// module.paths should include path to project's node_modules unless in build
49
53
if ( isBuild ) {
50
54
expect ( modulePaths ) . not . toContain (
@@ -65,7 +69,7 @@ module.exports = async ({ client, projectPath, projectName, mode }) => {
65
69
vuePath = vuePath . replace ( '"' , '' )
66
70
// Vue should be bundled and not externalized (can't check in build because of NamedModulePlugin)
67
71
if ( ! isBuild ) {
68
- expect ( path . normalize ( vuePath ) ) . toBe (
72
+ expect ( path . posix . normalize ( vuePath ) ) . toBe (
69
73
'../../../node_modules/vue/dist/vue.runtime.esm.js'
70
74
)
71
75
}
@@ -78,7 +82,9 @@ module.exports = async ({ client, projectPath, projectName, mode }) => {
78
82
// Remove any quotes
79
83
mockExternalPath = mockExternalPath . replace ( '"' , '' )
80
84
// mockExternal should be externalized (can't check in build because of NamedModulePlugin)
81
- if ( ! isBuild ) expect ( path . normalize ( mockExternalPath ) ) . toBe ( 'mockExternal' )
85
+ if ( ! isBuild ) {
86
+ expect ( mockExternalPath ) . toBe ( 'mockExternal' )
87
+ }
82
88
} )
83
89
84
90
await client . getMainProcessLogs ( ) . then ( logs => {
@@ -105,6 +111,8 @@ module.exports = async ({ client, projectPath, projectName, mode }) => {
105
111
. split ( '=' ) [ 1 ]
106
112
// Parse modulePaths array
107
113
modulePaths = modulePaths . split ( ',' )
114
+ // Normalize paths
115
+ modulePaths = modulePaths . map ( p => path . normalize ( p ) )
108
116
// module.paths should include path to project's node_modules unless in build
109
117
if ( isBuild ) {
110
118
expect ( modulePaths ) . not . toContain (
@@ -124,6 +132,8 @@ module.exports = async ({ client, projectPath, projectName, mode }) => {
124
132
// Remove any quotes
125
133
mockExternalPath = mockExternalPath . replace ( '"' , '' )
126
134
// mockExternal should be externalized (can't check in build because of NamedModulePlugin)
127
- if ( ! isBuild ) expect ( mockExternalPath ) . toBe ( 'mockExternal' )
135
+ if ( ! isBuild ) {
136
+ expect ( mockExternalPath ) . toBe ( 'mockExternal' )
137
+ }
128
138
} )
129
139
}
0 commit comments