1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-03 09:49:20 +02:00

Add createdDate to videos

This commit is contained in:
Chocobozzz 2016-05-13 20:42:11 +02:00
parent 3fe81fa75e
commit bb10240ee1
6 changed files with 32 additions and 6 deletions

View file

@ -8,6 +8,7 @@ const pathUtils = require('path')
const request = require('supertest')
const testUtils = {
dateIsValid: dateIsValid,
flushTests: flushTests,
getFriendsList: getFriendsList,
getVideo: getVideo,
@ -28,6 +29,16 @@ const testUtils = {
// ---------------------- Export functions --------------------
function dateIsValid (dateString) {
const dateToCheck = new Date(dateString)
const now = new Date()
// Check if the interval is more than 2 minutes
if (now - dateToCheck > 120000) return false
return true
}
function flushTests (callback) {
exec('npm run clean:server:test', callback)
}