@@ -4,32 +4,36 @@ import * as fs from 'node:fs/promises'
44
55withFixture ( 'v2' , ( c ) => {
66 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' )
911
10- let { code, expected, language = 'html' } = JSON . parse ( fixture )
12+ let { code, expected, language = 'html' } = JSON . parse ( fixture )
1113
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+ } )
1518 } )
16- } )
1719
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
2022
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))
2830
29- expected = JSON . parse ( JSON . stringify ( expected ) . replaceAll ( '{{URI}}' , textDocument . uri ) )
31+ expected = JSON . parse ( JSON . stringify ( expected ) . replaceAll ( '{{URI}}' , textDocument . uri ) )
3032
31- expect ( res ) . toEqual ( expected )
32- } )
33+ expect ( res ) . toEqual ( expected )
34+ } ,
35+ 10000
36+ )
3337 }
3438
3539 // testFixture('conflict')
0 commit comments