]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/shared/checks.ts
Merge branch 'release/4.3.0' into develop
[github/Chocobozzz/PeerTube.git] / server / tests / shared / checks.ts
index dcc16d7ea492b5e7af6cbed515db436a7243db2e..55ebc6c3e18569b93436d42c24ebf46a6daa22b7 100644 (file)
@@ -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
 }