Skip to content

Possibly misleading comment suggesting importing the extension #194

@alzafacon

Description

@alzafacon

both example test files (sample/test/suite1/extension.test.ts, sample/test/suite2/extension.test.ts) have a comment

// You can import and use all API from the 'vscode' module
// as well as import your extension to test it
import * as vscode from 'vscode';
// import * as myExtension from '../extension';

I interpret this to mean that the activate method of the extension needs to be manually invoked. I believe this is the most natural interpretation. But that contradicts how the Extension Host starts up with the extension already.

I think what the comment is trying to say is that I can import my extension to test the supporting functions, classes, etc, I implemented and exported from the extension. Is this correct? if so, would it be reasonable to update the comment:

// as well as import your custom feature APIs from your extension for testing it

(Btw, I see the same thing in https://github.com/microsoft/vscode-extension-samples/blob/main/helloworld-test-sample/src/test/suite/extension.test.ts)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions