Skip to content

Conversation

@ElianHugh
Copy link
Collaborator

  • Introduces (very basic) unit testing for the workspace viewer

Also proposes unit testing through mocking the vscode API via the sinon library. E.g., we can "set" vscode.window.activeTextEditor via the following function:

export function mockActiveTextEditor(document: vscode.TextDocument, sandbox: sinon.SinonSandbox) {
    return sandbox.stub(vscode.window, 'activeTextEditor').value({
        document
    });
}

- Introduces unit testing for the background knitting of documents
(Also, an example of how we can use mocking/stubbing)
Copy link
Member

@renkun-ken renkun-ken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really nice work!

@ElianHugh ElianHugh merged commit db11fa0 into REditorSupport:master Feb 17, 2023
@ElianHugh ElianHugh deleted the unit-testing branch February 17, 2023 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants