Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make hover integration test pass #2050

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 22 additions & 25 deletions test/integrationTests/hoverProvider.integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,26 @@ import { RequestQueueCollection } from '../../src/omnisharp/requestQueue';
import { OmniSharpServer } from '../../src/omnisharp/server';
import { omnisharp } from '../../src/omnisharp/extension';

const chai = require('chai');
chai.use(require('chai-arrays'));
chai.use(require('chai-fs'));
const chai = require('chai');
chai.use(require('chai-arrays'));
chai.use(require('chai-fs'));

suite(`Hover Provider: ${testAssetWorkspace.description}`, function() {
suiteSetup(async function() {
suite(`Hover Provider: ${testAssetWorkspace.description}`, function () {
suiteSetup(async function () {
should();

let csharpExtension = vscode.extensions.getExtension("ms-vscode.csharp");
if (!csharpExtension.isActive) {
await csharpExtension.activate();
let csharpExtension = vscode.extensions.getExtension("ms-vscode.csharp");
if (!csharpExtension.isActive) {
await csharpExtension.activate();
}

await csharpExtension.exports.initializationFinished;
await omnisharp.restart();
});
});

test("Hover returns structured documentation with proper newlines", async function () {
test("Hover returns structured documentation with proper newlines", async function () {

let program =
`using System;
let program =
`using System;
namespace Test
{
class testissue
Expand All @@ -49,26 +48,24 @@ namespace Test
}
}
}`;
let fileUri = await testAssetWorkspace.projects[0].addFileWithContents("test1.cs", program);

await omnisharp.waitForEmptyEventQueue();

await vscode.commands.executeCommand("vscode.open", fileUri);

let c = await vscode.commands.executeCommand("vscode.executeHoverProvider", fileUri,new vscode.Position(10,29));

let answer:string =
`Checks if object is tagged with the tag.
let fileUri = await testAssetWorkspace.projects[0].addFileWithContents("hover.cs", program);
await omnisharp.restart();
await omnisharp.waitForEmptyEventQueue();
await vscode.commands.executeCommand("vscode.open", fileUri);
let c = await vscode.commands.executeCommand("vscode.executeHoverProvider", fileUri, new vscode.Position(10, 29));
let answer: string =
`Checks if object is tagged with the tag.

Parameters:

\t\tgameObject: The game object.
\t\ttagName: Name of the tag.

Returns true if object is tagged with tag.`;
expect(c[0].contents[0].value).to.equal(answer);

expect(c[0].contents[0].value).to.equal(answer);
});

teardown(async () => {
await testAssetWorkspace.cleanupWorkspace();
});
Expand Down