diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2016-05-13 20:42:11 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2016-05-13 20:42:11 +0200 |
commit | bb10240ee15d31a1cc17c0e3d748dde817e7d0cb (patch) | |
tree | d8063b68473aaf1c5f1debc241ebf0d3cb3e7391 /server/tests/api/utils.js | |
parent | 3fe81fa75eef5320876441539ab89988a04a6c49 (diff) | |
download | PeerTube-bb10240ee15d31a1cc17c0e3d748dde817e7d0cb.tar.gz PeerTube-bb10240ee15d31a1cc17c0e3d748dde817e7d0cb.tar.zst PeerTube-bb10240ee15d31a1cc17c0e3d748dde817e7d0cb.zip |
Add createdDate to videos
Diffstat (limited to 'server/tests/api/utils.js')
-rw-r--r-- | server/tests/api/utils.js | 11 |
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') | |||
8 | const request = require('supertest') | 8 | const request = require('supertest') |
9 | 9 | ||
10 | const testUtils = { | 10 | const 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 | ||
32 | function 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 | |||
31 | function flushTests (callback) { | 42 | function flushTests (callback) { |
32 | exec('npm run clean:server:test', callback) | 43 | exec('npm run clean:server:test', callback) |
33 | } | 44 | } |