-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
12 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,21 @@ | ||
import * as assert from "assert"; | ||
import * as path from "path"; | ||
import { EXTENSION_ID } from "../../extension"; | ||
import { EXTENSION_ID, server } from "../../extension"; | ||
|
||
// 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 { makeRequest } from "./sendPostRequest"; | ||
// import * as myExtension from '../extension'; | ||
|
||
async function sleep(ms: number): Promise<void> { | ||
return new Promise( | ||
(resolve) => setTimeout(resolve, ms)); | ||
} | ||
|
||
suite("Extension Test Suite", () => { | ||
suiteSetup(async () => { | ||
const sampleWorkspace = path.resolve(__dirname, "../../../sampleWorkspace"); | ||
let uri = vscode.Uri.file(sampleWorkspace); | ||
await vscode.commands.executeCommand("vscode.openFolder", uri); | ||
await sleep(3000); | ||
}); | ||
suiteSetup(async () => { }); | ||
|
||
suiteTeardown(() => {}); | ||
suiteTeardown(() => { }); | ||
|
||
test("check can list extensions", async () => { | ||
const address = server.address() as any; | ||
const extensionIds: string[] = (await makeRequest( | ||
"custom.listInstalledExtensions", | ||
[] | ||
[], address.port | ||
)) as string[]; | ||
assert(extensionIds.includes(EXTENSION_ID)); | ||
}); | ||
}).timeout(5000); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters