Skip to content

Commit

Permalink
Increase v2 test timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
bradlc committed Aug 29, 2023
1 parent c1c811e commit 31e28e8
Showing 1 changed file with 23 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,36 @@ import * as fs from 'node:fs/promises'

withFixture('v2', (c) => {
function testFixture(fixture) {
test(fixture, async () => {
fixture = await fs.readFile(`tests/code-actions/${fixture}.json`, 'utf8')
test(
fixture,
async () => {
fixture = await fs.readFile(`tests/code-actions/${fixture}.json`, 'utf8')

let { code, expected, language = 'html' } = JSON.parse(fixture)
let { code, expected, language = 'html' } = JSON.parse(fixture)

let promise = new Promise((resolve) => {
c.onNotification('textDocument/publishDiagnostics', ({ diagnostics }) => {
resolve(diagnostics)
let promise = new Promise((resolve) => {
c.onNotification('textDocument/publishDiagnostics', ({ diagnostics }) => {
resolve(diagnostics)
})
})
})

let textDocument = await c.openDocument({ text: code, lang: language })
let diagnostics = await promise
let textDocument = await c.openDocument({ text: code, lang: language })
let diagnostics = await promise

let res = await c.sendRequest('textDocument/codeAction', {
textDocument,
context: {
diagnostics,
},
})
// console.log(JSON.stringify(res))
let res = await c.sendRequest('textDocument/codeAction', {
textDocument,
context: {
diagnostics,
},
})
// console.log(JSON.stringify(res))

expected = JSON.parse(JSON.stringify(expected).replaceAll('{{URI}}', textDocument.uri))
expected = JSON.parse(JSON.stringify(expected).replaceAll('{{URI}}', textDocument.uri))

expect(res).toEqual(expected)
})
expect(res).toEqual(expected)
},
10000
)
}

// testFixture('conflict')
Expand Down

0 comments on commit 31e28e8

Please sign in to comment.