@@ -90,15 +90,16 @@ export const checkDevice = (
9090}
9191
9292export const getDisplayName = ( browser : string , device : DeviceType ) : string => {
93+ const result = `browser: ${ browser } `
9394 if ( device !== null ) {
9495 if ( typeof device === 'string' ) {
95- return `browser: ${ browser } device: ${ device } `
96+ return `${ result } device: ${ device } `
9697 }
9798 if ( device . name ) {
98- return `browser: ${ browser } device: ${ device . name } `
99+ return `${ result } device: ${ device . name } `
99100 }
100101 }
101- return `browser: ${ browser } `
102+ return result
102103}
103104
104105export const getBrowserType = ( browser ?: BrowserType ) : BrowserType => {
@@ -113,7 +114,7 @@ export const generateKey = (
113114export const getDeviceBrowserType = (
114115 device : ConfigDeviceType ,
115116 availableDevices : Playwright [ 'devices' ] ,
116- ) : BrowserType | null => {
117+ ) : Nullable < BrowserType > => {
117118 if ( typeof device === 'string' ) {
118119 return availableDevices [ device ] . defaultBrowserType as BrowserType
119120 }
@@ -192,7 +193,7 @@ export const getSkipFlag = (
192193}
193194
194195export const readConfig = async (
195- rootDir : string = process . cwd ( ) ,
196+ rootDir = process . cwd ( ) ,
196197 jestEnvConfig ?: JestPlaywrightConfig ,
197198) : Promise < JestPlaywrightConfig > => {
198199 if ( jestEnvConfig ) {
@@ -217,6 +218,10 @@ export const readConfig = async (
217218 }
218219
219220 const localConfig = await require ( absConfigPath )
221+ if ( typeof localConfig === 'function' ) {
222+ const config = await localConfig ( )
223+ return deepMerge < JestPlaywrightConfig > ( DEFAULT_CONFIG , config )
224+ }
220225 return deepMerge < JestPlaywrightConfig > ( DEFAULT_CONFIG , localConfig )
221226}
222227
0 commit comments