@@ -4,36 +4,32 @@ import * as fs from 'node:fs/promises'
44
55withFixture ( 'v2' , ( c ) => {
66 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' )
119
12- let { code, expected, language = 'html' } = JSON . parse ( fixture )
10+ let { code, expected, language = 'html' } = JSON . parse ( fixture )
1311
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 )
1815 } )
16+ } )
1917
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
2220
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))
3028
31- expected = JSON . parse ( JSON . stringify ( expected ) . replaceAll ( '{{URI}}' , textDocument . uri ) )
29+ expected = JSON . parse ( JSON . stringify ( expected ) . replaceAll ( '{{URI}}' , textDocument . uri ) )
3230
33- expect ( res ) . toEqual ( expected )
34- } ,
35- 10000
36- )
31+ expect ( res ) . toEqual ( expected )
32+ } )
3733 }
3834
3935 // testFixture('conflict')
0 commit comments