Skip to content

Commit a11c42a

Browse files
committed
Change where files are opened in Razor integration tests
1 parent 47de8d4 commit a11c42a

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

test/razorIntegrationTests/formatting.integration.test.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import * as path from 'path';
77
import * as vscode from 'vscode';
8-
import { describe, beforeAll, afterAll, test, expect } from '@jest/globals';
8+
import { describe, beforeAll, afterAll, test, expect, beforeEach } from '@jest/globals';
99
import testAssetWorkspace from './testAssets/testAssetWorkspace';
1010
import * as integrationHelpers from '../integrationTests/integrationHelpers';
1111

@@ -20,10 +20,13 @@ describe(`Razor Formatting ${testAssetWorkspace.description}`, function () {
2020
const htmlConfig = vscode.workspace.getConfiguration('html');
2121
await htmlConfig.update('format.enable', true);
2222

23-
await integrationHelpers.openFileInWorkspaceAsync(path.join('Pages', 'BadlyFormatted.razor'));
2423
await integrationHelpers.activateCSharpExtension();
2524
});
2625

26+
beforeEach(async function () {
27+
await integrationHelpers.openFileInWorkspaceAsync(path.join('Pages', 'BadlyFormatted.razor'));
28+
});
29+
2730
afterAll(async () => {
2831
await testAssetWorkspace.cleanupWorkspace();
2932
});

test/razorIntegrationTests/hover.integration.test.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import * as path from 'path';
77
import * as vscode from 'vscode';
8-
import { describe, beforeAll, afterAll, test, expect } from '@jest/globals';
8+
import { describe, beforeAll, afterAll, test, expect, beforeEach } from '@jest/globals';
99
import testAssetWorkspace from './testAssets/testAssetWorkspace';
1010
import * as integrationHelpers from '../integrationTests/integrationHelpers';
1111

@@ -15,10 +15,13 @@ describe(`Razor Hover ${testAssetWorkspace.description}`, function () {
1515
return;
1616
}
1717

18-
await integrationHelpers.openFileInWorkspaceAsync(path.join('Pages', 'Index.cshtml'));
1918
await integrationHelpers.activateCSharpExtension();
2019
});
2120

21+
beforeEach(async function () {
22+
await integrationHelpers.openFileInWorkspaceAsync(path.join('Pages', 'Index.cshtml'));
23+
});
24+
2225
afterAll(async () => {
2326
await testAssetWorkspace.cleanupWorkspace();
2427
});

0 commit comments

Comments
 (0)