X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;ds=sidebyside;f=server%2Ftests%2Fshared%2Fchecks.ts;h=55ebc6c3e18569b93436d42c24ebf46a6daa22b7;hb=91a4893063402d7beabb3104f9b989b8f88b6038;hp=dcc16d7ea492b5e7af6cbed515db436a7243db2e;hpb=c47c3bcb0a9265d2a414ec96075052f8619d3f21;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/shared/checks.ts b/server/tests/shared/checks.ts index dcc16d7ea..55ebc6c3e 100644 --- a/server/tests/shared/checks.ts +++ b/server/tests/shared/checks.ts @@ -19,12 +19,22 @@ function expectStartWith (str: string, start: string) { expect(str.startsWith(start), `${str} does not start with ${start}`).to.be.true } +function expectNotStartWith (str: string, start: string) { + expect(str.startsWith(start), `${str} does not start with ${start}`).to.be.false +} + async function expectLogDoesNotContain (server: PeerTubeServer, str: string) { const content = await server.servers.getLogContent() expect(content.toString()).to.not.contain(str) } +async function expectLogContain (server: PeerTubeServer, str: string) { + const content = await server.servers.getLogContent() + + expect(content.toString()).to.contain(str) +} + async function testImage (url: string, imageName: string, imageHTTPPath: string, extension = '.jpg') { const res = await makeGetRequest({ url, @@ -92,7 +102,9 @@ export { expectLogDoesNotContain, testFileExistsOrNot, expectStartWith, + expectNotStartWith, checkBadStartPagination, checkBadCountPagination, - checkBadSortPagination + checkBadSortPagination, + expectLogContain }