jest-playwright icon indicating copy to clipboard operation
jest-playwright copied to clipboard

global.ts config can't be specified from testEnvironmentOptions, as described in docs

Open Rendez opened this issue 4 years ago • 3 comments

I haven't tried this repo yet, but I was scanning thru the code.

As of now, only config.serverOptions is used inside global.ts, but the config is read from a jest-playwright config (either default file path or specified via ENV variable). In the docs says you can alternatively specify testEnvironmentOptions['jest-playwright'], which I think it's a great idea (one that jest-puppeteer lacks). This however isn't correct for the case I just mentioned.

Is my assumption correct? https://github.com/playwright-community/jest-playwright/blob/master/src/global.ts#L38

Rendez avatar Mar 09 '21 01:03 Rendez

One solution could be what is proposed here: https://github.com/facebook/jest/issues/9930

Rendez avatar Mar 09 '21 09:03 Rendez

@Rendez yes& This is true. We have TODO here that there is problem in this case. https://github.com/playwright-community/jest-playwright/blob/13acc493ca79bd74605e0e35aeaf8ba3bc07442b/src/global.ts#L29

This is something that related to Jest and i agree that we should put in Readme

mmarkelov avatar Mar 09 '21 13:03 mmarkelov

Feel free to close this issue when ready, and let's hope future versions of jest globals ship that fix some time.

Rendez avatar Mar 09 '21 18:03 Rendez