Skip to content

Instantly share code, notes, and snippets.

@ryanluker
Created June 27, 2018 03:38
Show Gist options
  • Save ryanluker/636d39686f65495a63e2cc88002603b3 to your computer and use it in GitHub Desktop.
Save ryanluker/636d39686f65495a63e2cc88002603b3 to your computer and use it in GitHub Desktop.
test("Run display coverage on node test file @integration", async () => {
const extension = await vscode.extensions.getExtension("ryanluker.vscode-coverage-gutters");
const getCachedLines = extension.exports;
const testCoverage = await vscode.workspace.findFiles("**/test-coverage.js", "**/node_modules/**");
const testDocument = await vscode.workspace.openTextDocument(testCoverage[0]);
const testEditor = await vscode.window.showTextDocument(testDocument);
await vscode.commands.executeCommand("extension.displayCoverage");
// Wait for decorations to load
await sleep(2000);
// Look for exact coverage on the file
const cachedLines: ICoverageLines = getCachedLines();
assert.equal(14, cachedLines.full.length);
assert.equal(4, cachedLines.none.length);
assert.equal(7, cachedLines.partial.length);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment