Referencing the information found at https://jestjs.io/docs/en/configuration#testenvironment-string, within my Jest configuration I have set the
"testEnvironment": "<rootDir>/scripts/testEnvironment.js"
. The testEnvironment.js file houses a custom class with methods like setup(), teardown(), and handleTestEvent().
Is there a way to retrieve the file name from one of the Jest hooks, such as run_describe_start
, test_start
, or any other hook?