@@ -60,6 +60,9 @@ if (process.platform === 'linux') {
60
60
61
61
describe ( '[create-electron-vite] e2e tests' , async ( ) => {
62
62
test ( 'startup' , async ( ) => {
63
+ console . log ( '[e2e] npm-install.log:\n' , readFileSync ( 'npm-install.log' ) )
64
+ console . log ( '[e2e] vite-build.log:\n' , readFileSync ( 'vite-build.log' ) )
65
+
63
66
const title = await page . title ( )
64
67
expect ( title ) . eq ( 'Vite + Vue + TS' )
65
68
} )
@@ -98,15 +101,14 @@ async function createProject() {
98
101
99
102
// For local testing
100
103
function enableElectronMirror ( ) {
101
- const npmrc = path . join ( generatePath , '.npmrc' )
102
- let npmrcContent = fs . readFileSync ( npmrc , 'utf8' )
104
+ let npmrcContent = readFileSync ( '.npmrc' )
103
105
104
106
npmrcContent = npmrcContent
105
107
. split ( '\n' )
106
- . map ( ( line ) => line . includes ( 'electron_mirror' ) ? line . replace ( '#' , '' ) . trim ( ) : line )
108
+ . map ( ( line ) => line . includes ( 'electron_mirror' ) ? line . replace ( '#' , '' ) . trimStart ( ) : line )
107
109
. join ( '\n' )
108
110
109
- fs . writeFileSync ( npmrc , npmrcContent )
111
+ writeFileSync ( '. npmrc' , npmrcContent )
110
112
}
111
113
112
114
function execSync ( command : string ) {
@@ -117,6 +119,10 @@ function writeFileSync(file: string, content: string) {
117
119
return fs . writeFileSync ( path . join ( generatePath , file ) , content )
118
120
}
119
121
122
+ function readFileSync ( file : string ) {
123
+ return fs . readFileSync ( path . join ( generatePath , file ) , 'utf8' )
124
+ }
125
+
120
126
function intervalTask < R > ( fn : ( args : { stop : ( ) => void } ) => R | Promise < R > , options ?: {
121
127
delay ?: number
122
128
timeout ?: number
0 commit comments