@@ -205,28 +205,38 @@ describe('getBrowserType', () => {
205
205
} )
206
206
207
207
describe ( 'getBrowserOptions' , ( ) => {
208
- it ( 'should return undefined for empty options' , async ( ) => {
208
+ it ( 'should return empty object for empty options' , ( ) => {
209
209
const options = getBrowserOptions ( CHROMIUM )
210
- expect ( options ) . toBe ( undefined )
210
+ expect ( options ) . toStrictEqual ( { } )
211
211
} )
212
212
213
- it ( 'should return root options' , async ( ) => {
213
+ it ( 'should return root options' , ( ) => {
214
214
const launchOptions = { headless : false }
215
215
const options = getBrowserOptions ( CHROMIUM , launchOptions )
216
- expect ( options ) . toBe ( launchOptions )
216
+ expect ( options ) . toStrictEqual ( launchOptions )
217
217
} )
218
218
219
- it ( 'should return options for defined browser' , async ( ) => {
219
+ it ( 'should return options for defined browser' , ( ) => {
220
220
const launchOptions = { headless : false , chromium : { headless : true } }
221
221
const options = getBrowserOptions ( CHROMIUM , launchOptions )
222
222
expect ( options ) . toStrictEqual ( { headless : true } )
223
223
} )
224
224
225
- it ( 'should return root options for other browser' , async ( ) => {
225
+ it ( 'should return root options for other browser' , ( ) => {
226
226
const launchOptions = { headless : false , chromium : { headless : true } }
227
227
const options = getBrowserOptions ( FIREFOX , launchOptions )
228
228
expect ( options ) . toStrictEqual ( { headless : false } )
229
229
} )
230
+
231
+ it ( 'should not mutate original options' , ( ) => {
232
+ const launchOptions = { headless : false , chromium : { headless : true } }
233
+ const options = getBrowserOptions ( FIREFOX , launchOptions )
234
+ expect ( options ) . toStrictEqual ( { headless : false } )
235
+ expect ( launchOptions ) . toStrictEqual ( {
236
+ headless : false ,
237
+ chromium : { headless : true } ,
238
+ } )
239
+ } )
230
240
} )
231
241
232
242
describe ( 'checkBrowserEnv' , ( ) => {
0 commit comments