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

18 lines
482 B
TypeScript
Raw Normal View History

2021-07-08 11:49:38 +02:00
import { expect } from 'chai'
import * as request from 'supertest'
import { HttpStatusCode } from '../../core-utils/miscs/http-error-codes'
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
}