Skip to content

Commit 7bdde23

Browse files
author
Ravi Chande
authored
Merge pull request #2002 from akshita31/integrationTest
Clean up Integration Test
2 parents 456d2bc + 6ab25a2 commit 7bdde23

File tree

2 files changed

+10
-13
lines changed

2 files changed

+10
-13
lines changed

test/integrationTests/codeActionRename.integration.test.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,19 @@ suite(`Code Action Rename ${testAssetWorkspace.description}`, function() {
2727

2828
});
2929

30-
test("Code actions can remame and open files", async () => {
30+
test("Code actions can rename and open files", async () => {
3131
let fileUri = await testAssetWorkspace.projects[0].addFileWithContents("test.cs", "class C {}");
3232
await vscode.commands.executeCommand("vscode.open", fileUri);
3333
let c = await vscode.commands.executeCommand("vscode.executeCodeActionProvider", fileUri, new vscode.Range(0, 7, 0, 7)) as {command: string, title: string, arguments: string[]}[];
3434
let command = c.find(
35-
(s) => { return s.title == "Rename file to C.cs" }
36-
)
35+
(s) => { return s.title == "Rename file to C.cs"; }
36+
);
3737
expect(command, "Didn't find rename class command");
3838
await vscode.commands.executeCommand(command.command, ...command.arguments)
3939
expect(vscode.window.activeTextEditor.document.fileName).contains("C.cs");
4040
});
41+
42+
teardown(async () => {
43+
await testAssetWorkspace.cleanupWorkspace();
44+
});
4145
});

test/integrationTests/hoverProvider.integration.test.ts

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,17 @@ const chai = require('chai');
1717
chai.use(require('chai-arrays'));
1818
chai.use(require('chai-fs'));
1919

20-
suite(`Tasks generation: ${testAssetWorkspace.description}`, function() {
20+
suite(`Hover Provider: ${testAssetWorkspace.description}`, function() {
2121
suiteSetup(async function() {
2222
should();
2323

24-
await testAssetWorkspace.cleanupWorkspace();
25-
2624
let csharpExtension = vscode.extensions.getExtension("ms-vscode.csharp");
2725
if (!csharpExtension.isActive) {
2826
await csharpExtension.activate();
2927
}
3028

3129
await csharpExtension.exports.initializationFinished;
3230
await omnisharp.restart();
33-
34-
await vscode.commands.executeCommand("dotnet.generateAssets");
35-
36-
await poll(async () => await fs.exists(testAssetWorkspace.launchJsonPath), 10000, 100);
37-
3831
});
3932

4033
test("Hover returns structured documentation with proper newlines", async function () {
@@ -48,7 +41,7 @@ namespace Test
4841
///<summary>Checks if object is tagged with the tag.</summary>
4942
/// <param name="gameObject">The game object.</param>
5043
/// <param name="tagName">Name of the tag.</param>
51-
/// <returns>Returns <c> true</c> if object is tagged with tag.</returns>
44+
/// <returns>Returns <c>true</c> if object is tagged with tag.</returns>
5245
5346
public static bool Compare(int gameObject,string tagName)
5447
{
@@ -72,7 +65,7 @@ Parameters:
7265
\t\tgameObject: The game object.
7366
\t\ttagName: Name of the tag.
7467
75-
Returns true if object is tagged with tag.`;
68+
Returns true if object is tagged with tag.`;
7669
expect(c[0].contents[0].value).to.equal(answer);
7770
});
7871

0 commit comments

Comments
 (0)