PeerTube/shared/extra-utils/videos/captions.ts

18 lines
452 B
TypeScript
Raw Normal View History

2021-07-08 04:49:38 -05:00
import { expect } from 'chai'
2021-08-27 07:32:44 -05:00
import request from 'supertest'
2021-07-16 03:42:24 -05:00
import { HttpStatusCode } from '@shared/models'
2021-07-08 04:49:38 -05:00
async function testCaptionFile (url: string, captionPath: string, containsString: string) {
const res = await request(url)
.get(captionPath)
.expect(HttpStatusCode.OK_200)
expect(res.text).to.contain(containsString)
}
// ---------------------------------------------------------------------------
export {
testCaptionFile
}