Skip to content

assertion failure in async bdd feature step does not fail the scenario #1520

Closed

Description

@RohanHart

What are you trying to achieve?

Add a custom assertion to an async bdd step.

eg.,
Then(..., async () => {
const data = await I.grabTextFrom(...)
ok(data === 'foo')
}

What do you get instead?

the scenario is incorrectly marked successful and also raises an UnhandledPromiseRejectionWarning

Details

  • CodeceptJS version: 2.0.4
  • NodeJS Version: 8.11.4
  • Operating System: Linux
  • Puppeteer: 1.11.0

Activity

  1. RohanHart commented on Feb 25, 2019

    @RohanHart
    ContributorAuthor

    Looking deeper it seems that the typescript step definition is not being recognised as async in isAsyncFunction.

    As it is not an error to await a non-promise (they are treated as resolved promises) the simple fix is #1526

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions