fix tests

This commit is contained in:
Hongbo Wu
2024-02-22 12:03:58 +08:00
parent 34db7bb2d8
commit 8b848912c9
10 changed files with 20 additions and 24 deletions

View File

@ -1,5 +1,5 @@
import 'mocha'
import { expect } from 'chai'
import 'mocha'
import { validateUrl } from '../../src/services/create_page_save_request'
describe('validateUrl', () => {

View File

@ -1,12 +1,12 @@
import 'mocha'
import { expect } from 'chai'
import 'mocha'
import { getHighlightLocation } from '../../src/services/highlights'
describe('getHighlightLocation', () => {
let patch: string
let location: number
before(async () => {
before(() => {
location = 109
patch = `@@ -${location + 1},16 +${location + 1},36 @@
. We're
@ -18,7 +18,7 @@ describe('getHighlightLocation', () => {
coming`
})
it('returns highlight location from patch', async () => {
it('returns highlight location from patch', () => {
const result = getHighlightLocation(patch)
expect(result).to.eql(location)
})