Unable to test asynchronous code
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 30/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- javascript, node.js
- Domain
- testing-qa
Research direction
Start with lib/child.js at the _require function and trace how code-to-test.js is loaded before unit-tests.js runs. Evaluate the proposed promise-export approach and define the expected behavior for asynchronous dependencies. Done means the loading sequence waits correctly and the relevant asynchronous test cases pass.
Written by the indexing model from the issue text.
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
- Dominant language
- JavaScript
- Stars
- 171
- Forks
- 51
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from qunitjs/node-qunit
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
qunitjs/node-qunit#140 ·
-
documentation help welcome problem
Difficulty 1/5 Under an hour Newbie friendliness 55/100
qunitjs/node-qunit#135 ·
-
problem
Difficulty 3/5 1-2 days Newbie friendliness 42/100
qunitjs/node-qunit#131 · 1 comment ·
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 35/100
qunitjs/node-qunit#128 · 3 comments ·
-
problem support
Difficulty 3/5 1-2 days Newbie friendliness 35/100
qunitjs/node-qunit#116 ·
All issues in qunitjs/node-qunit
Similar issues
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
babalae/bettergi-scripts-list#3674 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
vadimdemedes/ink#1029 ·
-
code-quality refactoring
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
optimization optimization:agents-md-curator
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
githubnext/gh-aw-cao#13143 ·