Skip to content

Test extraction fails on timeout expression #79

@eliericha

Description

@eliericha

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: microsoft/vscode-extension-samples@ef56355

Let me know if you need more info.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions