question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Detox v20 - custom environment can't call super.handleTestEvent

See original GitHub issue

What happened?

I’ve just updated our project to Detox v20 and was following this guide: https://wix.github.io/Detox/docs/config/testRunner/#jest-config It incorrectly shows how you can override handleTestEvent. This is the proposed approach:

async handleTestEvent(event, state) {
    await super.handleTestEvent(event, state);
    // custom code
 }

however this is not working, you need to do it like this:

handleTestEvent = async (event, state) => {
   await super.handleTestEvent(event, state);
    // custom code
}

if you need I can create a PR to update the docs to correctly reflect this, or to update the testEnvironment file to match the documentation.

What was the expected behaviour?

No response

Was it tested on latest Detox?

  • I have tested this issue on the latest Detox release and it still reproduces.

Help us reproduce this issue!

No response

In what environment did this happen?

Detox version: React Native version: Node version: Test-runner (select one): jest / other

Detox logs

Detox logs
paste logs here!

Device logs

Device logs
paste logs here!

More data, please!

No response

Issue Analytics

  • State:open
  • Created 10 months ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
noomorphcommented, Nov 24, 2022

Thanks for the suggestion. Well, I have a vacation currently. I’ll be able to handle this next week.

0reactions
adamivanczacommented, Dec 12, 2022

any update on this @noomorph ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Detox : Please add both arguments to super() call in your ...
If you replace constructor and super with the new syntax. class CustomDetoxEnvironment extends DetoxCircusEnvironment {. constructor(config) { ...
Read more >
Migration Guide | Detox
Otherwise, stay with your custom test environment but make sure to migrate it as was described earlier. Stop using timeline artifacts​. If you...
Read more >
Detox - bytemeta
Detox repo issues. ... Detox v20 breaks Cucumber tests integration. daankennes ... Detox v20 - custom environment can't call super.handleTestEvent.
Read more >
Wix Detox Statistics & Issues - Codesti
Wix Detox: Gray box end-to-end testing and automation framework for mobile apps Check out Wix Detox ... Detox v20 - custom environment can't...
Read more >
Wix from Detox repository issues - Github Lab
View Comments (6). User Image open adamivancza Updated 2 weeks ago. Detox v20 - custom environment can't call super.handleTestEvent · View Comments (5) ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found