microsoft / microsoft/vscode-extension-test-runner

Test extraction fails on timeout expression

Open
#79 1 comment 0 reactions 0 assignees View on GitHub

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.