-
Notifications
You must be signed in to change notification settings - Fork 53
/
Copy pathextension.test.ts
41 lines (35 loc) · 1.39 KB
/
extension.test.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*---------------------------------------------------------------------------------------------
* Alexa Skills Toolkit for Visual Studio Code
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*--------------------------------------------------------------------------------------------*/
"use stirct";
import * as assert from "assert";
import * as vscode from "vscode";
import {EXTENSION_PUBLISHER, EXTENSION_FULL_NAME} from "../src/constants";
import {ext} from "../src/extensionGlobals";
import * as sinon from "sinon";
import * as s3ScriptChecker from "../src/utils/s3ScriptChecker";
const extensionId = `${EXTENSION_PUBLISHER}.${EXTENSION_FULL_NAME}`;
describe("Alexa Skill Kit Extension", () => {
let extension: vscode.Extension<any> | undefined;
it("Extension should be present", () => {
extension = vscode.extensions.getExtension(extensionId);
assert.ok(extension !== undefined);
});
it("should activate", async () => {
extension = vscode.extensions.getExtension(extensionId);
if (extension !== undefined) {
sinon.stub(s3ScriptChecker, "checkAllSkillS3Scripts");
await extension.activate();
assert.ok(extension.isActive);
} else {
assert.fail("Extension is not available");
}
});
after(() => {
ext.askGeneralCommands.forEach((command) => {
command.dispose();
});
});
});