Skip to content

Wait for plan execution #1918

Closed
Closed
@afoninsky

Description

@afoninsky

I want to create helper, which will wait for execution plan or throw an error on timeout. This will reduce boilerplate required for clean test functions.

Example:

test('some test', async t => {
  t.plan(3)
  ...
  // lots of async stuff
  ...
  await myHelper(t, 3000) // will wait 3 seconds and throw `Planned for 3 assertions, but got 2`
})
  1. Is there any workaround to get current execution plan in test? I couldn't find it :(
  2. What about proposal t.planWait(3000)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions