microsoft/vscode-react-native

Public

mirrored from https://github.com/microsoft/vscode-react-nativeAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
fedb8b9422daaac6072e1a09072c2f7f5077df44

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

test/extension/elementInspector.test.ts

40lines · modecode

1// Copyright (c) Microsoft Corporation. All rights reserved.
2// Licensed under the MIT license. See LICENSE file in the project root for details.
3
4import { CommandPaletteHandler } from "../../src/extension/commandPaletteHandler";
5import * as assert from "assert";
6
7
8suite("elementInspector", function() {
9 suite("extensionContext", function () {
10
11 test("element inspector should run and closed without errors", function(done: MochaDone) {
12 CommandPaletteHandler.runElementInspector();
13 assert.notEqual(CommandPaletteHandler.elementInspector, null);
14
15 if (CommandPaletteHandler.elementInspector) {
16 CommandPaletteHandler.elementInspector.once("exit", () => {
17 assert.equal(CommandPaletteHandler.elementInspector, null);
18 done();
19 });
20 } else {
21 assert.ifError("element inspector didn't launch properly");
22 }
23 CommandPaletteHandler.stopElementInspector();
24 });
25
26 test("element inspector should not allow multiple windows to run", function(done: MochaDone) {
27 CommandPaletteHandler.runElementInspector();
28 if (CommandPaletteHandler.elementInspector) {
29 let PID = CommandPaletteHandler.elementInspector.pid;
30 CommandPaletteHandler.runElementInspector();
31 assert.equal(CommandPaletteHandler.elementInspector.pid, PID);
32 CommandPaletteHandler.stopElementInspector();
33 done();
34 } else {
35 assert.ifError("element inspector didn't launch properly");
36 }
37 });
38 });
39
40});