@@ -4,32 +4,36 @@ import * as fs from 'node:fs/promises'
4
4
5
5
withFixture ( 'v2' , ( c ) => {
6
6
function testFixture ( fixture ) {
7
- test ( fixture , async ( ) => {
8
- fixture = await fs . readFile ( `tests/code-actions/${ fixture } .json` , 'utf8' )
7
+ test (
8
+ fixture ,
9
+ async ( ) => {
10
+ fixture = await fs . readFile ( `tests/code-actions/${ fixture } .json` , 'utf8' )
9
11
10
- let { code, expected, language = 'html' } = JSON . parse ( fixture )
12
+ let { code, expected, language = 'html' } = JSON . parse ( fixture )
11
13
12
- let promise = new Promise ( ( resolve ) => {
13
- c . onNotification ( 'textDocument/publishDiagnostics' , ( { diagnostics } ) => {
14
- resolve ( diagnostics )
14
+ let promise = new Promise ( ( resolve ) => {
15
+ c . onNotification ( 'textDocument/publishDiagnostics' , ( { diagnostics } ) => {
16
+ resolve ( diagnostics )
17
+ } )
15
18
} )
16
- } )
17
19
18
- let textDocument = await c . openDocument ( { text : code , lang : language } )
19
- let diagnostics = await promise
20
+ let textDocument = await c . openDocument ( { text : code , lang : language } )
21
+ let diagnostics = await promise
20
22
21
- let res = await c . sendRequest ( 'textDocument/codeAction' , {
22
- textDocument,
23
- context : {
24
- diagnostics,
25
- } ,
26
- } )
27
- // console.log(JSON.stringify(res))
23
+ let res = await c . sendRequest ( 'textDocument/codeAction' , {
24
+ textDocument,
25
+ context : {
26
+ diagnostics,
27
+ } ,
28
+ } )
29
+ // console.log(JSON.stringify(res))
28
30
29
- expected = JSON . parse ( JSON . stringify ( expected ) . replaceAll ( '{{URI}}' , textDocument . uri ) )
31
+ expected = JSON . parse ( JSON . stringify ( expected ) . replaceAll ( '{{URI}}' , textDocument . uri ) )
30
32
31
- expect ( res ) . toEqual ( expected )
32
- } )
33
+ expect ( res ) . toEqual ( expected )
34
+ } ,
35
+ 10000
36
+ )
33
37
}
34
38
35
39
// testFixture('conflict')
0 commit comments