From dc19c3577118601f19055d26d0460cd52d34d170 Mon Sep 17 00:00:00 2001 From: Akshita Agarwal Date: Fri, 2 Feb 2018 11:52:09 -0800 Subject: [PATCH 1/2] Clean up integration tests --- .../codeActionRename.integration.test.ts | 10 +++++++--- .../integrationTests/hoverProvider.integration.test.ts | 9 +-------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/test/integrationTests/codeActionRename.integration.test.ts b/test/integrationTests/codeActionRename.integration.test.ts index b2be1f4d59..2930d25c54 100644 --- a/test/integrationTests/codeActionRename.integration.test.ts +++ b/test/integrationTests/codeActionRename.integration.test.ts @@ -27,15 +27,19 @@ suite(`Code Action Rename ${testAssetWorkspace.description}`, function() { }); - test("Code actions can remame and open files", async () => { + test("Code actions can rename and open files", async () => { let fileUri = await testAssetWorkspace.projects[0].addFileWithContents("test.cs", "class C {}"); await vscode.commands.executeCommand("vscode.open", fileUri); let c = await vscode.commands.executeCommand("vscode.executeCodeActionProvider", fileUri, new vscode.Range(0, 7, 0, 7)) as {command: string, title: string, arguments: string[]}[]; let command = c.find( - (s) => { return s.title == "Rename file to C.cs" } - ) + (s) => { return s.title == "Rename file to C.cs"; } + ); expect(command, "Didn't find rename class command"); await vscode.commands.executeCommand(command.command, ...command.arguments) expect(vscode.window.activeTextEditor.document.fileName).contains("C.cs"); }); + + teardown(async () => { + await testAssetWorkspace.cleanupWorkspace(); + }); }); \ No newline at end of file diff --git a/test/integrationTests/hoverProvider.integration.test.ts b/test/integrationTests/hoverProvider.integration.test.ts index 04fdcf3d23..7ce8ec07b7 100644 --- a/test/integrationTests/hoverProvider.integration.test.ts +++ b/test/integrationTests/hoverProvider.integration.test.ts @@ -17,12 +17,10 @@ const chai = require('chai'); chai.use(require('chai-arrays')); chai.use(require('chai-fs')); -suite(`Tasks generation: ${testAssetWorkspace.description}`, function() { +suite(`Hover Provider: ${testAssetWorkspace.description}`, function() { suiteSetup(async function() { should(); - await testAssetWorkspace.cleanupWorkspace(); - let csharpExtension = vscode.extensions.getExtension("ms-vscode.csharp"); if (!csharpExtension.isActive) { await csharpExtension.activate(); @@ -30,11 +28,6 @@ suite(`Tasks generation: ${testAssetWorkspace.description}`, function() { await csharpExtension.exports.initializationFinished; await omnisharp.restart(); - - await vscode.commands.executeCommand("dotnet.generateAssets"); - - await poll(async () => await fs.exists(testAssetWorkspace.launchJsonPath), 10000, 100); - }); test("Hover returns structured documentation with proper newlines", async function () { From 1dbadca654646baafbf06cfe5253bbfe3d8e5bce Mon Sep 17 00:00:00 2001 From: Akshita Agarwal Date: Fri, 2 Feb 2018 11:57:47 -0800 Subject: [PATCH 2/2] Clean up --- test/integrationTests/hoverProvider.integration.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/integrationTests/hoverProvider.integration.test.ts b/test/integrationTests/hoverProvider.integration.test.ts index 7ce8ec07b7..8bf8639162 100644 --- a/test/integrationTests/hoverProvider.integration.test.ts +++ b/test/integrationTests/hoverProvider.integration.test.ts @@ -41,7 +41,7 @@ namespace Test ///Checks if object is tagged with the tag. /// The game object. /// Name of the tag. - /// Returns true if object is tagged with tag. + /// Returns true if object is tagged with tag. public static bool Compare(int gameObject,string tagName) { @@ -65,7 +65,7 @@ Parameters: \t\tgameObject: The game object. \t\ttagName: Name of the tag. -Returns true if object is tagged with tag.`; +Returns true if object is tagged with tag.`; expect(c[0].contents[0].value).to.equal(answer); });