Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic unit test for workspace viewer #1305

Merged
merged 5 commits into from
Feb 17, 2023

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.

None yet

2 participants