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:
parent
3fe81fa75e
commit
bb10240ee1
6 changed files with 32 additions and 6 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue