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