5
5
6
6
import * as path from 'path' ;
7
7
import * as vscode from 'vscode' ;
8
- import { describe , beforeAll , afterAll , test , expect } from '@jest/globals' ;
8
+ import { describe , beforeAll , afterAll , test , expect , beforeEach , afterEach } from '@jest/globals' ;
9
9
import testAssetWorkspace from './testAssets/testAssetWorkspace' ;
10
10
import * as integrationHelpers from './integrationHelpers' ;
11
11
import { InlayHint , InlayHintKind , Position } from 'vscode-languageserver-protocol' ;
12
12
13
- describe ( `[${ testAssetWorkspace . description } ] Test LSP Inlay Hints ` , function ( ) {
14
- beforeAll ( async function ( ) {
13
+ describe ( `[${ testAssetWorkspace . description } ] Test LSP Inlay Hints ` , ( ) => {
14
+ beforeAll ( async ( ) => {
15
15
const editorConfig = vscode . workspace . getConfiguration ( 'editor' ) ;
16
16
await editorConfig . update ( 'inlayHints.enabled' , true ) ;
17
17
const dotnetConfig = vscode . workspace . getConfiguration ( 'dotnet' ) ;
@@ -30,14 +30,21 @@ describe(`[${testAssetWorkspace.description}] Test LSP Inlay Hints `, function (
30
30
await csharpConfig . update ( 'inlayHints.enableInlayHintsForLambdaParameterTypes' , true ) ;
31
31
await csharpConfig . update ( 'inlayHints.enableInlayHintsForImplicitObjectCreation' , true ) ;
32
32
33
- await integrationHelpers . openFileInWorkspaceAsync ( path . join ( 'src' , 'app' , 'inlayHints.cs' ) ) ;
34
33
await integrationHelpers . activateCSharpExtension ( ) ;
35
34
} ) ;
36
35
36
+ beforeEach ( async ( ) => {
37
+ await integrationHelpers . openFileInWorkspaceAsync ( path . join ( 'src' , 'app' , 'inlayHints.cs' ) ) ;
38
+ } ) ;
39
+
37
40
afterAll ( async ( ) => {
38
41
await testAssetWorkspace . cleanupWorkspace ( ) ;
39
42
} ) ;
40
43
44
+ afterEach ( async ( ) => {
45
+ await integrationHelpers . closeAllEditorsAsync ( ) ;
46
+ } ) ;
47
+
41
48
test ( 'Hints retrieved for region' , async ( ) => {
42
49
const range = new vscode . Range ( new vscode . Position ( 4 , 8 ) , new vscode . Position ( 15 , 85 ) ) ;
43
50
const activeDocument = vscode . window . activeTextEditor ?. document . uri ;
0 commit comments