From bf54587a3e2ad9c2c186828f2a5682b91ee2cc00 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 17 Dec 2021 09:29:23 +0100 Subject: shared/ typescript types dir server-commands --- shared/server-commands/videos/captions.ts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 shared/server-commands/videos/captions.ts (limited to 'shared/server-commands/videos/captions.ts') diff --git a/shared/server-commands/videos/captions.ts b/shared/server-commands/videos/captions.ts new file mode 100644 index 000000000..35e722408 --- /dev/null +++ b/shared/server-commands/videos/captions.ts @@ -0,0 +1,21 @@ +import { expect } from 'chai' +import request from 'supertest' +import { HttpStatusCode } from '@shared/models' + +async function testCaptionFile (url: string, captionPath: string, toTest: RegExp | string) { + const res = await request(url) + .get(captionPath) + .expect(HttpStatusCode.OK_200) + + if (toTest instanceof RegExp) { + expect(res.text).to.match(toTest) + } else { + expect(res.text).to.contain(toTest) + } +} + +// --------------------------------------------------------------------------- + +export { + testCaptionFile +} -- cgit v1.2.3