CodeceptJS get test file on events

Hello all,

I’m writing a framework using CodeceptJS and I’m wondering if it’s possible to get the file that is running the test on the ‘event.test.failed’ event.
On the documentation ( it says that I can access to file, but on my code it says undefined.

Any idea/help, please?


File should be available.

 event.dispatcher.on(event.test.failed, test => {
    debug(`event.test.failed - ${test.file}`);

Hi David,

Thanks for your reply.
I’m afraid is not working. I replaced my code for your line, but still undefined

event.dispatcher.on(event.test.failed, test => {
    console.log(`event.test.failed - ${test.file}`);

event.test.failed - undefined

Any idea why?
I am using codeceptjs 1.4.5