Skip to content

Unable to test asynchronous code #142

Open
@ArnaudBuchholz

Description

Guys,

I am fully aware of the asynchronous helpers built in QUnit and I use them whenever the test is asynchronous. However, the problem I am dealing with is the code itself that is asynchronous.

For instance:

testrunner.run({
    code: 'code-to-test.js',
    tests: 'unit-tests.js'
})

In that example, code-to-test.js is actually loading asynchronous dependencies and I would like QUnit to wait before running the corresponding unit tests.

Checking node-qunit code, I would like child.js's _require function to be asynchronous.

Thinking about the way we could tell the function that it has to wait, I was thinking that if the loaded module exports a promise, we could wait for it to be resolved before continuing the load.

Any thoughts?

  • Arnaud

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