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

Unable to test asynchronous code #142

Open
ArnaudBuchholz opened this issue May 21, 2019 · 1 comment
Open

Unable to test asynchronous code #142

ArnaudBuchholz opened this issue May 21, 2019 · 1 comment
Labels

Comments

@ArnaudBuchholz
Copy link

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
@Krinkle
Copy link
Member

Krinkle commented Jun 19, 2019

@ArnaudBuchholz Note that the main qunit package now has a CLI as well, which is more actively maintained and might suit your needs?

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

No branches or pull requests

2 participants