How to correctly type BeforeEach hook parameters in global setup file #620
Unanswered
kerrabelly
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to generate a file name using test title in BeforeEach but am struggling to properly type the params and testInfo arguments. I don't want to use fixtures because i have lot of spec files to override to, I want to achieve this using BeforeEach at global level
BeforeEach(async (testInfo) => {
const testTitle = testInfo.title;
const date = new Date();
const timestamp = date.getTime();
const filename =
test_${testTitle.replace(/\s+/g, '_')}_${timestamp}.log
;});
What is the correct way to type these params for BeforeEach? Getting confusing errors.
Beta Was this translation helpful? Give feedback.
All reactions