UNPKG

teamsfx-extension

Version:

Create, debug, and deploy Teams apps with Teams Toolkit

138 lines 6.74 kB
// Copyright (c) Microsoft Corporation. // Licensed under the MIT license. "use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", { value: true }); const chai = require("chai"); const fs = require("fs-extra"); const extensionVariables_1 = require("../../../src/extensionVariables"); const globalVaribles_1 = require("../../globalVaribles"); const testUserInput_1 = require("../../testUserInput"); const child_process_1 = require("child_process"); suite("Extension Integration Tests (Specified Folder)", () => __awaiter(void 0, void 0, void 0, function* () { suiteSetup(function () { return __awaiter(this, void 0, void 0, function* () { this.timeout(0); chai.assert.ok(fs.existsSync(globalVaribles_1.testWorkspace)); extensionVariables_1.ext.ui = new testUserInput_1.TestUserInput(); console.debug("[TEST] do `npm install` in the scaffold folder."); child_process_1.execSync("npm install", { cwd: globalVaribles_1.testWorkspace }); }); }); // test("Provision", async function(this: Mocha.Context) { // // use default values of every user input. // ext.ui.showInformationMessage(`[TEST]: execute 'fx-extension.provision' command.`); // const result: Result<null, FxError> | undefined = await vscode.commands.executeCommand( // "fx-extension.provision" // ); // chai.assert.ok(result && result.isOk()); // }); // test("Deploy", async function (this: Mocha.Context) { // // use default values of every user input. // ext.ui.showInformationMessage( // `[TEST]: execute 'fx-extension.deploy' command.`, // ); // const result: // | Result<null, FxError> // | undefined = await vscode.commands.executeCommand( // "fx-extension.deploy", // ); // chai.assert.ok(result && result.isOk()); // }); // test("Debug", async function(this: Mocha.Context) { // // use default values of every user input. // ext.ui.showInformationMessage(`[TEST]: execute 'fx-extension.debug' command.`); // const result: Result<null, FxError> | undefined = await vscode.commands.executeCommand( // "fx-extension.debug" // ); // chai.assert.ok(result && result.isOk()); // }); // test("Build", async function(this: Mocha.Context) { // // use default values of every user input. // ext.ui.showInformationMessage(`[TEST]: execute 'fx-extension.build' command.`); // const result: Result<null, FxError> | undefined = await vscode.commands.executeCommand( // "fx-extension.build" // ); // chai.assert.ok(result && result.isOk()); // }); // test("Publish", async function(this: Mocha.Context) { // // use default values of every user input. // ext.ui.showInformationMessage(`[TEST]: execute 'fx-extension.publish' command.`); // const result: Result<null, FxError> | undefined = await vscode.commands.executeCommand( // "fx-extension.publish" // ); // chai.assert.ok(result && result.isOk()); // }); // test("Scaffold One", async function (this: Mocha.Context) { // this.timeout(0); // // use default values of every user input. // ext.ui.showInformationMessage( // `[TEST]: execute 'fx-extension.scaffoldOne' command.`, // ); // try { // await vscode.commands.executeCommand( // "fx-extension.scaffoldOne", // ); // chai.assert.ok(false, "[Test] it should be an error"); // } catch (error) { // console.debug("OK"); // } // }); // test("Provision One", async function(this: Mocha.Context) { // // use default values of every user input. // ext.ui.showInformationMessage(`[TEST]: execute 'fx-extension.provisionOne' command.`); // const result: Result<null, FxError> | undefined = await vscode.commands.executeCommand( // "fx-extension.provisionOne" // ); // chai.assert.ok(result && result.isOk()); // }); // test("Debug One", async function(this: Mocha.Context) { // // use default values of every user input. // ext.ui.showInformationMessage(`[TEST]: execute 'fx-extension.debugOne' command.`); // const result: Result<null, FxError> | undefined = await vscode.commands.executeCommand( // "fx-extension.debugOne" // ); // chai.assert.ok(result && result.isOk()); // }); // test("Build One", async function(this: Mocha.Context) { // // use default values of every user input. // ext.ui.showInformationMessage(`[TEST]: execute 'fx-extension.buildOne' command.`); // const result: Result<null, FxError> | undefined = await vscode.commands.executeCommand( // "fx-extension.buildOne" // ); // chai.assert.ok(result && result.isOk()); // }); // test("Deploy One", async function (this: Mocha.Context) { // // use default values of every user input. // ext.ui.showInformationMessage( // `[TEST]: execute 'fx-extension.deployOne' command.`, // ); // const result: // | Result<null, FxError> // | undefined = await vscode.commands.executeCommand( // "fx-extension.deployOne", // ); // chai.assert.ok(result && result.isOk()); // }); // test("Publish One", async function(this: Mocha.Context) { // // use default values of every user input. // ext.ui.showInformationMessage(`[TEST]: execute 'fx-extension.publishOne' command.`); // const result: Result<null, FxError> | undefined = await vscode.commands.executeCommand( // "fx-extension.publishOne" // ); // chai.assert.ok(result && result.isOk()); // }); suiteTeardown(() => { // TODO: meet Error: EBUSY: resource busy or locked, rmdir. // fs.removeSync(testWorkspace); }); })); //# sourceMappingURL=extension.folder.test.js.map