Skip to content

Lost assertions in async tests #50

@pygy

Description

@pygy

It is currently possible to have assertions that run after the test that defined them, and at that point, ospec is unacle to trace their origin.

One possibility to solve this would be to change the API to something tape-like:

o("test", o => {
  // this would either refuse to work
  setTimeout(()=>o(1).equals(false), 5)
})

If we were to implement this, we'd need a complimentary codemod to upgrade the test suites. If someone skilled in theses want to step up and write it would be most welcome. Otherwise I'll dive into it.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions