Skip to content

Commit

Permalink
Fix async tests
Browse files Browse the repository at this point in the history
  • Loading branch information
James-Yu committed Jun 21, 2023
1 parent 434d891 commit db049f3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/suites/07_mathpreview.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ suite('Math preview test suite', () => {
await test.reset()
})

test.run('mathpreviewlib/cursorrenderer: test insertCursor', () => {
test.run('mathpreviewlib/cursorrenderer: test insertCursor', async () => {
const docString = '$a+b$'
const doc = new TextDocumentLike(docString)
const cursorPos = new vscode.Position(0, 2)
const texMath = TeXMathEnvFinder.findMathEnvIncludingPosition(doc, cursorPos)
assert.ok(texMath)
const result = texMath && testTools.insertCursor(texMath, cursorPos, '|')
const result = texMath && await testTools.insertCursor(texMath, cursorPos, '|')
assert.strictEqual(result, '$a|+b$')
})

Expand Down Expand Up @@ -53,23 +53,23 @@ suite('Math preview test suite', () => {

})

test.run('mathpreviewlib/cursorrenderer: test \\f|rac{1}{2}', () => {
test.run('mathpreviewlib/cursorrenderer: test \\f|rac{1}{2}', async () => {
const docString = '$\\frac{1}{2}$'
const doc = new TextDocumentLike(docString)
const cursorPos = new vscode.Position(0, 3)
const texMath = TeXMathEnvFinder.findMathEnvIncludingPosition(doc, cursorPos)
assert.ok(texMath)
const result = texMath && testTools.insertCursor(texMath, cursorPos, '|')
const result = texMath && await testTools.insertCursor(texMath, cursorPos, '|')
assert.strictEqual(result, '$\\frac{1}{2}$')
})

test.run('mathpreviewlib/cursorrenderer: test a^|b', () => {
test.run('mathpreviewlib/cursorrenderer: test a^|b', async () => {
const docString = '$a^b$'
const doc = new TextDocumentLike(docString)
const cursorPos = new vscode.Position(0, 3)
const texMath = TeXMathEnvFinder.findMathEnvIncludingPosition(doc, cursorPos)
assert.ok(texMath)
const result = texMath && testTools.insertCursor(texMath, cursorPos, '|')
const result = texMath && await testTools.insertCursor(texMath, cursorPos, '|')
assert.strictEqual(result, '$a^|b$')
})
})

0 comments on commit db049f3

Please sign in to comment.