aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/extra-utils/miscs/checks.ts
diff options
context:
space:
mode:
Diffstat (limited to 'shared/extra-utils/miscs/checks.ts')
-rw-r--r--shared/extra-utils/miscs/checks.ts7
1 files changed, 6 insertions, 1 deletions
diff --git a/shared/extra-utils/miscs/checks.ts b/shared/extra-utils/miscs/checks.ts
index 7fc92f804..aa2c8e8fa 100644
--- a/shared/extra-utils/miscs/checks.ts
+++ b/shared/extra-utils/miscs/checks.ts
@@ -16,6 +16,10 @@ function dateIsValid (dateString: string, interval = 300000) {
16 return Math.abs(now.getTime() - dateToCheck.getTime()) <= interval 16 return Math.abs(now.getTime() - dateToCheck.getTime()) <= interval
17} 17}
18 18
19function expectStartWith (str: string, start: string) {
20 expect(str.startsWith(start), `${str} does not start with ${start}`).to.be.true
21}
22
19async function testImage (url: string, imageName: string, imagePath: string, extension = '.jpg') { 23async function testImage (url: string, imageName: string, imagePath: string, extension = '.jpg') {
20 const res = await makeGetRequest({ 24 const res = await makeGetRequest({
21 url, 25 url,
@@ -42,5 +46,6 @@ async function testFileExistsOrNot (server: PeerTubeServer, directory: string, f
42export { 46export {
43 dateIsValid, 47 dateIsValid,
44 testImage, 48 testImage,
45 testFileExistsOrNot 49 testFileExistsOrNot,
50 expectStartWith
46} 51}