microsoft / microsoft/vscode-extension-test-runner
Test extraction fails on timeout expression
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 17
- Forks
- 15
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 2
Description
The test extraction fails when the testsuite code includes a complex expression setting the timeout:
suite('Extension Test Suite', function () {
this.timeout(
// Both of these expressions cause an error in
// the extraction of tests. Initially I thought
// it was the use of 'Math' but the second expression
// shows that it wasn't the issue.
Math.max(5, this.timeout())
// this.timeout() > 5 ? this.timeout() : 5
);
The error is reported as a red node in the Test Explorer tree with the label: Cannot convert object to primitive value.
I couldn't find any useful logs in the output channels.
I created a reproducer here: https://github.com/microsoft/vscode-extension-samples/commit/ef56355782fdd7a225e6da39514c3e1af3b65b3d
Let me know if you need more info.
Thanks!
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.
Research direction
Start with the linked vscode-extension-samples reproducer and the test-extraction entry point, using the timeout expression shown in the issue. Trace why the expression produces “Cannot convert object to primitive value”; done means the tests are extracted without the red Test Explorer node or that error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100