Skip to content

--coverage option for Unit Tests causes tests to hang #145593

@Charles-Gagnon

Description

@Charles-Gagnon
  1. Run test.[sh|bat] --coverage

After a bit this message will appear in the console :

[12796:0321/103318.476:INFO:CONSOLE(108)] "Uncaught SyntaxError: Unexpected token '??'", source: node:vm (108)

and it will hang there and never run any tests.

The error message itself isn't very helpful, but after making the change locally in this PR : microsoft/vscode-loader#37 it shows that the issue is coming from editorGroupView.ts

[19692:0321/104213.849:INFO:CONSOLE(912)] "Uncaught Error: Error compiling file:///C:/src/vscode/out/vs/workbench/browser/parts/editor/editorGroupView.js. SyntaxError: Unexpected to ken '??'", source: C:\src\vscode\out\vs\loader.js (912)

I've tracked it down to this line specifically - https://github.com/Microsoft/vscode/blob/e2ce6d92a90e1f7adc73a31ed725809b72a2edfb/src/vs/workbench/browser/parts/editor/editorGroupView.ts#L1008

Refactoring it to remove the ?? fixes the issue and allows the tests to run as expected.

pinned: options?.sticky || !this.accessor.partOptions.enablePreview || editor.isDirty() || (options?.pinned !== null ? options?.pinned : typeof options?.index === 'number' /* unless specified, prefer to pin when opening with index */) || (typeof options?.index === 'number' && this.model.isSticky(options.index)),

There seems to be some issue with the Istanbul libs that causes incorrect coverage code to be generated, I stopped my investigation there so I don't have any more information beyond that.

Metadata

Metadata

Assignees

Labels

*out-of-scopePosted issue is not in scope of VS Code

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions