Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass down context to onTestFinished and onTestFailed instead of test result #6132

Closed
4 tasks done
sheremet-va opened this issue Jul 15, 2024 · 0 comments · Fixed by #7034
Closed
4 tasks done

Pass down context to onTestFinished and onTestFailed instead of test result #6132

sheremet-va opened this issue Jul 15, 2024 · 0 comments · Fixed by #7034
Labels
breaking change p2-nice-to-have Not breaking anything but nice to have (priority)

Comments

@sheremet-va
Copy link
Member

Clear and concise description of the problem

There is no benefit in receiving only test results. It's also available on conext.task.result if required.

Suggested solution

Pass down test context to onTestFinished and onTestFailed hooks:

test('some test', (ctx) => {
  ctx.info = 'some info'
  if (something()) {
    ctx.info = 'some other info'
  }
  onTestFinished((ctx) => {
    if(ctx.info === 'some info') {
      // do a thing
    }
  })
})

Alternative

No response

Additional context

No response

Validations

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
breaking change p2-nice-to-have Not breaking anything but nice to have (priority)
Projects
None yet
1 participant