aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/utils.js
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/api/utils.js')
-rw-r--r--server/tests/api/utils.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/server/tests/api/utils.js b/server/tests/api/utils.js
index f0b1c3653..d505cb5d9 100644
--- a/server/tests/api/utils.js
+++ b/server/tests/api/utils.js
@@ -8,6 +8,7 @@ const pathUtils = require('path')
8const request = require('supertest') 8const request = require('supertest')
9 9
10const testUtils = { 10const testUtils = {
11 dateIsValid: dateIsValid,
11 flushTests: flushTests, 12 flushTests: flushTests,
12 getFriendsList: getFriendsList, 13 getFriendsList: getFriendsList,
13 getVideo: getVideo, 14 getVideo: getVideo,
@@ -28,6 +29,16 @@ const testUtils = {
28 29
29// ---------------------- Export functions -------------------- 30// ---------------------- Export functions --------------------
30 31
32function dateIsValid (dateString) {
33 const dateToCheck = new Date(dateString)
34 const now = new Date()
35
36 // Check if the interval is more than 2 minutes
37 if (now - dateToCheck > 120000) return false
38
39 return true
40}
41
31function flushTests (callback) { 42function flushTests (callback) {
32 exec('npm run clean:server:test', callback) 43 exec('npm run clean:server:test', callback)
33} 44}