@@ -62,8 +62,8 @@ describe('.gitignore', () => {
62
62
'apiResolve_./.gitignore' ,
63
63
expect . any ( String )
64
64
)
65
- // Only background.js should have been written
66
- expect ( fs . writeFileSync ) . toHaveBeenCalledTimes ( 1 )
65
+ // Nothing should have been written
66
+ expect ( fs . writeFileSync ) . toHaveBeenCalledTimes ( 0 )
67
67
} )
68
68
69
69
test . each ( [ '#Electron-builder output' , '/dist_electron' ] ) (
@@ -90,43 +90,12 @@ describe('.gitignore', () => {
90
90
'apiResolve_./.gitignore' ,
91
91
expect . any ( String )
92
92
)
93
- // Only index should have been written
94
- expect ( fs . writeFileSync ) . toHaveBeenCalledTimes ( 1 )
93
+ // Nothing should have been written
94
+ expect ( fs . writeFileSync ) . toHaveBeenCalledTimes ( 0 )
95
95
}
96
96
)
97
97
} )
98
98
99
- describe ( 'index.html' , ( ) => {
100
- test . each ( [
101
- // None
102
- '' ,
103
- // Base URL
104
- ` <% if (BASE_URL === './') { %><base href="app://./" /><% } %>\n`
105
- ] ) ( 'Only add missing tags to index.html' , existing => {
106
- // Disable .gitignore modification
107
- fs . existsSync . mockReturnValueOnce ( false )
108
- fs . readFileSync . mockImplementation ( ( path , encoding ) => {
109
- // Check that utf8 encoding is set
110
- expect ( encoding ) . toBe ( 'utf8' )
111
- if ( path === 'apiResolve_./package.json' ) {
112
- return JSON . stringify ( { scripts : { } } )
113
- }
114
- // return mock content
115
- return ` <head>\n${ existing } </head>`
116
- } )
117
-
118
- // Run the generator with mock api
119
- generator ( mockApi )
120
- // Run the onCreateComplete callback
121
- completionCb ( )
122
-
123
- const index = fs . writeFileSync . mock . calls [ 0 ] [ 1 ]
124
- expect ( index ) . toBe ( ` <head>
125
- <% if (BASE_URL === './') { %><base href="app://./" /><% } %>
126
- </head>` )
127
- } )
128
- } )
129
-
130
99
describe ( 'background.js' , ( ) => {
131
100
test . each ( [ false , true ] ) (
132
101
'Background file is not added if it exists' ,
0 commit comments