Skip to content

Commit 9507516

Browse files
Restore test assets at suite setup
1 parent 72986b7 commit 9507516

7 files changed

+19
-1
lines changed

src/features/commands.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ async function getProjectDescriptors(server: OmniSharpServer): Promise<protocol.
147147
return descriptors;
148148
}
149149

150-
async function dotnetRestore(cwd: string, eventStream: EventStream, filePath?: string): Promise<void> {
150+
export async function dotnetRestore(cwd: string, eventStream: EventStream, filePath?: string): Promise<void> {
151151
return new Promise<void>((resolve, reject) => {
152152
let cmd = 'dotnet';
153153
let args = ['restore'];

test/integrationTests/codeActionRename.integration.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import * as vscode from 'vscode';
88
import { should, expect } from 'chai';
99
import { activateCSharpExtension } from './integrationHelpers';
1010
import testAssetWorkspace from './testAssets/testAssetWorkspace';
11+
import { dotnetRestore } from '../../src/features/commands';
12+
import { EventStream } from '../../src/EventStream';
1113

1214
const chai = require('chai');
1315
chai.use(require('chai-arrays'));
@@ -16,6 +18,7 @@ chai.use(require('chai-fs'));
1618
suite(`Code Action Rename ${testAssetWorkspace.description}`, function () {
1719
suiteSetup(async function () {
1820
should();
21+
await dotnetRestore(vscode.workspace.rootPath, new EventStream());
1922
await activateCSharpExtension();
2023
});
2124

test/integrationTests/codeLensProvider.integration.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import * as path from 'path';
99
import { should, expect } from 'chai';
1010
import { activateCSharpExtension } from './integrationHelpers';
1111
import testAssetWorkspace from './testAssets/testAssetWorkspace';
12+
import { dotnetRestore } from '../../src/features/commands';
13+
import { EventStream } from '../../src/EventStream';
1214

1315
const chai = require('chai');
1416
chai.use(require('chai-arrays'));
@@ -19,6 +21,7 @@ suite(`CodeLensProvider: ${testAssetWorkspace.description}`, function () {
1921

2022
suiteSetup(async function () {
2123
should();
24+
await dotnetRestore(vscode.workspace.rootPath, new EventStream());
2225
await activateCSharpExtension();
2326

2427
let fileName = 'Program.cs';

test/integrationTests/documentSymbolProvider.integration.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import * as path from 'path';
99
import { should, expect } from 'chai';
1010
import { activateCSharpExtension } from './integrationHelpers';
1111
import testAssetWorkspace from './testAssets/testAssetWorkspace';
12+
import { dotnetRestore } from '../../src/features/commands';
13+
import { EventStream } from '../../src/EventStream';
1214

1315
const chai = require('chai');
1416
chai.use(require('chai-arrays'));
@@ -19,6 +21,7 @@ suite(`DocumentSymbolProvider: ${testAssetWorkspace.description}`, function () {
1921

2022
suiteSetup(async function () {
2123
should();
24+
await dotnetRestore(vscode.workspace.rootPath, new EventStream());
2225
await activateCSharpExtension();
2326

2427
let fileName = 'documentSymbols.cs';

test/integrationTests/hoverProvider.integration.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import * as path from 'path';
99
import { should, expect } from 'chai';
1010
import { activateCSharpExtension } from './integrationHelpers';
1111
import testAssetWorkspace from './testAssets/testAssetWorkspace';
12+
import { dotnetRestore } from '../../src/features/commands';
13+
import { EventStream } from '../../src/EventStream';
1214

1315
const chai = require('chai');
1416
chai.use(require('chai-arrays'));
@@ -17,6 +19,7 @@ chai.use(require('chai-fs'));
1719
suite(`Hover Provider: ${testAssetWorkspace.description}`, function () {
1820
suiteSetup(async function () {
1921
should();
22+
await dotnetRestore(vscode.workspace.rootPath, new EventStream());
2023
await activateCSharpExtension();
2124
});
2225

test/integrationTests/launchConfiguration.integration.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import poll from './poll';
1010
import { should, expect } from 'chai';
1111
import { activateCSharpExtension } from './integrationHelpers';
1212
import testAssetWorkspace from './testAssets/testAssetWorkspace';
13+
import { dotnetRestore } from '../../src/features/commands';
14+
import { EventStream } from '../../src/EventStream';
1315

1416
const chai = require('chai');
1517
chai.use(require('chai-arrays'));
@@ -18,6 +20,7 @@ chai.use(require('chai-fs'));
1820
suite(`Tasks generation: ${testAssetWorkspace.description}`, function () {
1921
suiteSetup(async function () {
2022
should();
23+
await dotnetRestore(vscode.workspace.rootPath, new EventStream());
2124
await activateCSharpExtension();
2225

2326
await vscode.commands.executeCommand("dotnet.generateAssets");

test/integrationTests/signatureHelp.integration.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import * as path from 'path';
99
import { should, expect } from 'chai';
1010
import { activateCSharpExtension } from './integrationHelpers';
1111
import testAssetWorkspace from './testAssets/testAssetWorkspace';
12+
import { dotnetRestore } from '../../src/features/commands';
13+
import { EventStream } from '../../src/EventStream';
1214

1315
const chai = require('chai');
1416
chai.use(require('chai-arrays'));
@@ -19,6 +21,7 @@ suite(`SignatureHelp: ${testAssetWorkspace.description}`, function () {
1921

2022
suiteSetup(async function () {
2123
should();
24+
await dotnetRestore(vscode.workspace.rootPath, new EventStream());
2225
await activateCSharpExtension();
2326

2427
let fileName = 'sigHelp.cs';

0 commit comments

Comments
 (0)