From 8d30905858245f12a42fc327d2d57cbfe062d548 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Sun, 7 Aug 2016 22:09:59 +0200 Subject: Server: split tests utils in multiple files --- server/tests/utils/clients.js | 24 +++++ server/tests/utils/login.js | 48 ++++++++++ server/tests/utils/miscs.js | 21 +++++ server/tests/utils/pods.js | 70 +++++++++++++++ server/tests/utils/servers.js | 115 ++++++++++++++++++++++++ server/tests/utils/users.js | 85 ++++++++++++++++++ server/tests/utils/videos.js | 199 ++++++++++++++++++++++++++++++++++++++++++ 7 files changed, 562 insertions(+) create mode 100644 server/tests/utils/clients.js create mode 100644 server/tests/utils/login.js create mode 100644 server/tests/utils/miscs.js create mode 100644 server/tests/utils/pods.js create mode 100644 server/tests/utils/servers.js create mode 100644 server/tests/utils/users.js create mode 100644 server/tests/utils/videos.js (limited to 'server/tests/utils') diff --git a/server/tests/utils/clients.js b/server/tests/utils/clients.js new file mode 100644 index 000000000..e3ded493e --- /dev/null +++ b/server/tests/utils/clients.js @@ -0,0 +1,24 @@ +'use strict' + +const request = require('supertest') + +const clientsUtils = { + getClient: getClient +} + +// ---------------------- Export functions -------------------- + +function getClient (url, end) { + const path = '/api/v1/users/client' + + request(url) + .get(path) + .set('Accept', 'application/json') + .expect(200) + .expect('Content-Type', /json/) + .end(end) +} + +// --------------------------------------------------------------------------- + +module.exports = clientsUtils diff --git a/server/tests/utils/login.js b/server/tests/utils/login.js new file mode 100644 index 000000000..1a5d75bc4 --- /dev/null +++ b/server/tests/utils/login.js @@ -0,0 +1,48 @@ +'use strict' + +const request = require('supertest') + +const loginUtils = { + login: login, + loginAndGetAccessToken: loginAndGetAccessToken +} + +// ---------------------- Export functions -------------------- + +function login (url, client, user, expectedStatus, end) { + if (!end) { + end = expectedStatus + expectedStatus = 200 + } + + const path = '/api/v1/users/token' + + const body = { + client_id: client.id, + client_secret: client.secret, + username: user.username, + password: user.password, + response_type: 'code', + grant_type: 'password', + scope: 'upload' + } + + request(url) + .post(path) + .type('form') + .send(body) + .expect(expectedStatus) + .end(end) +} + +function loginAndGetAccessToken (server, callback) { + login(server.url, server.client, server.user, 200, function (err, res) { + if (err) return callback(err) + + return callback(null, res.body.access_token) + }) +} + +// --------------------------------------------------------------------------- + +module.exports = loginUtils diff --git a/server/tests/utils/miscs.js b/server/tests/utils/miscs.js new file mode 100644 index 000000000..5414cd561 --- /dev/null +++ b/server/tests/utils/miscs.js @@ -0,0 +1,21 @@ +'use strict' + +const miscsUtils = { + dateIsValid: dateIsValid +} + +// ---------------------- 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 +} + +// --------------------------------------------------------------------------- + +module.exports = miscsUtils diff --git a/server/tests/utils/pods.js b/server/tests/utils/pods.js new file mode 100644 index 000000000..366492110 --- /dev/null +++ b/server/tests/utils/pods.js @@ -0,0 +1,70 @@ +'use strict' + +const request = require('supertest') + +const podsUtils = { + getFriendsList: getFriendsList, + makeFriends: makeFriends, + quitFriends: quitFriends +} + +// ---------------------- Export functions -------------------- + +function getFriendsList (url, end) { + const path = '/api/v1/pods/' + + request(url) + .get(path) + .set('Accept', 'application/json') + .expect(200) + .expect('Content-Type', /json/) + .end(end) +} + +function makeFriends (url, accessToken, expectedStatus, end) { + if (!end) { + end = expectedStatus + expectedStatus = 204 + } + + const path = '/api/v1/pods/makefriends' + + // The first pod make friend with the third + request(url) + .get(path) + .set('Accept', 'application/json') + .set('Authorization', 'Bearer ' + accessToken) + .expect(expectedStatus) + .end(function (err, res) { + if (err) throw err + + // Wait for the request between pods + setTimeout(end, 1000) + }) +} + +function quitFriends (url, accessToken, expectedStatus, end) { + if (!end) { + end = expectedStatus + expectedStatus = 204 + } + + const path = '/api/v1/pods/quitfriends' + + // The first pod make friend with the third + request(url) + .get(path) + .set('Accept', 'application/json') + .set('Authorization', 'Bearer ' + accessToken) + .expect(expectedStatus) + .end(function (err, res) { + if (err) throw err + + // Wait for the request between pods + setTimeout(end, 1000) + }) +} + +// --------------------------------------------------------------------------- + +module.exports = podsUtils diff --git a/server/tests/utils/servers.js b/server/tests/utils/servers.js new file mode 100644 index 000000000..ee7cd8c0a --- /dev/null +++ b/server/tests/utils/servers.js @@ -0,0 +1,115 @@ +'use strict' + +const childProcess = require('child_process') +const exec = childProcess.exec +const fork = childProcess.fork +const pathUtils = require('path') + +const serversUtils = { + flushAndRunMultipleServers: flushAndRunMultipleServers, + flushTests: flushTests, + runServer: runServer +} + +// ---------------------- Export functions -------------------- + +function flushAndRunMultipleServers (totalServers, serversRun) { + let apps = [] + let urls = [] + let i = 0 + + function anotherServerDone (number, app, url) { + apps[number - 1] = app + urls[number - 1] = url + i++ + if (i === totalServers) { + serversRun(apps, urls) + } + } + + flushTests(function () { + for (let j = 1; j <= totalServers; j++) { + // For the virtual buffer + setTimeout(function () { + runServer(j, function (app, url) { + anotherServerDone(j, app, url) + }) + }, 1000 * j) + } + }) +} + +function flushTests (callback) { + exec('npm run clean:server:test', callback) +} + +function runServer (number, callback) { + const server = { + app: null, + url: `http://localhost:${9000 + number}`, + client: { + id: null, + secret: null + }, + user: { + username: null, + password: null + } + } + + // These actions are async so we need to be sure that they have both been done + const serverRunString = { + 'Connected to mongodb': false, + 'Server listening on port': false + } + + const regexps = { + client_id: 'Client id: ([a-f0-9]+)', + client_secret: 'Client secret: (.+)', + user_username: 'Username: (.+)', + user_password: 'User password: (.+)' + } + + // Share the environment + const env = Object.create(process.env) + env.NODE_ENV = 'test' + env.NODE_APP_INSTANCE = number + const options = { + silent: true, + env: env, + detached: true + } + + server.app = fork(pathUtils.join(__dirname, '../../../server.js'), [], options) + server.app.stdout.on('data', function onStdout (data) { + let dontContinue = false + + // Capture things if we want to + for (const key of Object.keys(regexps)) { + const regexp = regexps[key] + const matches = data.toString().match(regexp) + if (matches !== null) { + if (key === 'client_id') server.client.id = matches[1] + else if (key === 'client_secret') server.client.secret = matches[1] + else if (key === 'user_username') server.user.username = matches[1] + else if (key === 'user_password') server.user.password = matches[1] + } + } + + // Check if all required sentences are here + for (const key of Object.keys(serverRunString)) { + if (data.toString().indexOf(key) !== -1) serverRunString[key] = true + if (serverRunString[key] === false) dontContinue = true + } + + // If no, there is maybe one thing not already initialized (mongodb...) + if (dontContinue === true) return + + server.app.stdout.removeListener('data', onStdout) + callback(server) + }) +} + +// --------------------------------------------------------------------------- + +module.exports = serversUtils diff --git a/server/tests/utils/users.js b/server/tests/utils/users.js new file mode 100644 index 000000000..ed7a9d672 --- /dev/null +++ b/server/tests/utils/users.js @@ -0,0 +1,85 @@ +'use strict' + +const request = require('supertest') + +const usersUtils = { + createUser: createUser, + getUserInformation: getUserInformation, + getUsersList: getUsersList, + removeUser: removeUser, + updateUser: updateUser +} + +// ---------------------- Export functions -------------------- + +function createUser (url, accessToken, username, password, specialStatus, end) { + if (!end) { + end = specialStatus + specialStatus = 204 + } + + const path = '/api/v1/users' + + request(url) + .post(path) + .set('Accept', 'application/json') + .set('Authorization', 'Bearer ' + accessToken) + .send({ username: username, password: password }) + .expect(specialStatus) + .end(end) +} + +function getUserInformation (url, accessToken, end) { + const path = '/api/v1/users/me' + + request(url) + .get(path) + .set('Accept', 'application/json') + .set('Authorization', 'Bearer ' + accessToken) + .expect(200) + .expect('Content-Type', /json/) + .end(end) +} + +function getUsersList (url, end) { + const path = '/api/v1/users' + + request(url) + .get(path) + .set('Accept', 'application/json') + .expect(200) + .expect('Content-Type', /json/) + .end(end) +} + +function removeUser (url, token, username, expectedStatus, end) { + if (!end) { + end = expectedStatus + expectedStatus = 204 + } + + const path = '/api/v1/users' + + request(url) + .delete(path + '/' + username) + .set('Accept', 'application/json') + .set('Authorization', 'Bearer ' + token) + .expect(expectedStatus) + .end(end) +} + +function updateUser (url, userId, accessToken, newPassword, end) { + const path = '/api/v1/users/' + userId + + request(url) + .put(path) + .set('Accept', 'application/json') + .set('Authorization', 'Bearer ' + accessToken) + .send({ password: newPassword }) + .expect(204) + .end(end) +} + +// --------------------------------------------------------------------------- + +module.exports = usersUtils diff --git a/server/tests/utils/videos.js b/server/tests/utils/videos.js new file mode 100644 index 000000000..90ee9621e --- /dev/null +++ b/server/tests/utils/videos.js @@ -0,0 +1,199 @@ +'use strict' + +const fs = require('fs') +const pathUtils = require('path') +const request = require('supertest') + +const videosUtils = { + getAllVideosListBy: getAllVideosListBy, + getVideo: getVideo, + getVideosList: getVideosList, + getVideosListPagination: getVideosListPagination, + getVideosListSort: getVideosListSort, + removeVideo: removeVideo, + searchVideo: searchVideo, + searchVideoWithPagination: searchVideoWithPagination, + searchVideoWithSort: searchVideoWithSort, + testVideoImage: testVideoImage, + uploadVideo: uploadVideo +} + +// ---------------------- Export functions -------------------- + +function getAllVideosListBy (url, end) { + const path = '/api/v1/videos' + + request(url) + .get(path) + .query({ sort: 'createdDate' }) + .query({ start: 0 }) + .query({ count: 10000 }) + .set('Accept', 'application/json') + .expect(200) + .expect('Content-Type', /json/) + .end(end) +} + +function getVideo (url, id, end) { + const path = '/api/v1/videos/' + id + + request(url) + .get(path) + .set('Accept', 'application/json') + .expect(200) + .expect('Content-Type', /json/) + .end(end) +} + +function getVideosList (url, end) { + const path = '/api/v1/videos' + + request(url) + .get(path) + .query({ sort: 'name' }) + .set('Accept', 'application/json') + .expect(200) + .expect('Content-Type', /json/) + .end(end) +} + +function getVideosListPagination (url, start, count, end) { + const path = '/api/v1/videos' + + request(url) + .get(path) + .query({ start: start }) + .query({ count: count }) + .set('Accept', 'application/json') + .expect(200) + .expect('Content-Type', /json/) + .end(end) +} + +function getVideosListSort (url, sort, end) { + const path = '/api/v1/videos' + + request(url) + .get(path) + .query({ sort: sort }) + .set('Accept', 'application/json') + .expect(200) + .expect('Content-Type', /json/) + .end(end) +} + +function removeVideo (url, token, id, expectedStatus, end) { + if (!end) { + end = expectedStatus + expectedStatus = 204 + } + + const path = '/api/v1/videos' + + request(url) + .delete(path + '/' + id) + .set('Accept', 'application/json') + .set('Authorization', 'Bearer ' + token) + .expect(expectedStatus) + .end(end) +} + +function searchVideo (url, search, field, end) { + if (!end) { + end = field + field = null + } + + const path = '/api/v1/videos' + const req = request(url) + .get(path + '/search/' + search) + .set('Accept', 'application/json') + + if (field) req.query({ field: field }) + req.expect(200) + .expect('Content-Type', /json/) + .end(end) +} + +function searchVideoWithPagination (url, search, field, start, count, end) { + const path = '/api/v1/videos' + + request(url) + .get(path + '/search/' + search) + .query({ start: start }) + .query({ count: count }) + .query({ field: field }) + .set('Accept', 'application/json') + .expect(200) + .expect('Content-Type', /json/) + .end(end) +} + +function searchVideoWithSort (url, search, sort, end) { + const path = '/api/v1/videos' + + request(url) + .get(path + '/search/' + search) + .query({ sort: sort }) + .set('Accept', 'application/json') + .expect(200) + .expect('Content-Type', /json/) + .end(end) +} + +function testVideoImage (url, videoName, imagePath, callback) { + // Don't test images if the node env is not set + // Because we need a special ffmpeg version for this test + if (process.env.NODE_TEST_IMAGE) { + request(url) + .get(imagePath) + .expect(200) + .end(function (err, res) { + if (err) return callback(err) + + fs.readFile(pathUtils.join(__dirname, '..', 'api', 'fixtures', videoName + '.jpg'), function (err, data) { + if (err) return callback(err) + + callback(null, data.equals(res.body)) + }) + }) + } else { + console.log('Do not test images. Enable it by setting NODE_TEST_IMAGE env variable.') + callback(null, true) + } +} + +function uploadVideo (url, accessToken, name, description, tags, fixture, specialStatus, end) { + if (!end) { + end = specialStatus + specialStatus = 204 + } + + const path = '/api/v1/videos' + + const req = request(url) + .post(path) + .set('Accept', 'application/json') + .set('Authorization', 'Bearer ' + accessToken) + .field('name', name) + .field('description', description) + + for (let i = 0; i < tags.length; i++) { + req.field('tags[' + i + ']', tags[i]) + } + + let filepath = '' + if (pathUtils.isAbsolute(fixture)) { + filepath = fixture + } else { + filepath = pathUtils.join(__dirname, '..', 'api', 'fixtures', fixture) + } + + req.attach('videofile', filepath) + .expect(specialStatus) + .end(end) +} + +// --------------------------------------------------------------------------- + +module.exports = videosUtils -- cgit v1.2.3 From 25ed57f3db6301a5e87020b66d33671598e61df1 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Sun, 7 Aug 2016 22:18:14 +0200 Subject: Server: create requests utils module --- server/tests/utils/requests.js | 68 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 server/tests/utils/requests.js (limited to 'server/tests/utils') diff --git a/server/tests/utils/requests.js b/server/tests/utils/requests.js new file mode 100644 index 000000000..410e42c77 --- /dev/null +++ b/server/tests/utils/requests.js @@ -0,0 +1,68 @@ +'use strict' + +const request = require('supertest') + +const requestsUtils = { + makePostUploadRequest: makePostUploadRequest, + makePostBodyRequest: makePostBodyRequest, + makePutBodyRequest: makePutBodyRequest +} + +// ---------------------- Export functions -------------------- + +function makePostUploadRequest (url, path, token, fields, attaches, done, statusCodeExpected) { + if (!statusCodeExpected) statusCodeExpected = 400 + + const req = request(url) + .post(path) + .set('Accept', 'application/json') + + if (token) req.set('Authorization', 'Bearer ' + token) + + Object.keys(fields).forEach(function (field) { + const value = fields[field] + + if (Array.isArray(value)) { + for (let i = 0; i < value.length; i++) { + req.field(field + '[' + i + ']', value[i]) + } + } else { + req.field(field, value) + } + }) + + Object.keys(attaches).forEach(function (attach) { + const value = attaches[attach] + req.attach(attach, value) + }) + + req.expect(statusCodeExpected, done) +} + +function makePostBodyRequest (url, path, token, fields, done, statusCodeExpected) { + if (!statusCodeExpected) statusCodeExpected = 400 + + const req = request(url) + .post(path) + .set('Accept', 'application/json') + + if (token) req.set('Authorization', 'Bearer ' + token) + + req.send(fields).expect(statusCodeExpected, done) +} + +function makePutBodyRequest (url, path, token, fields, done, statusCodeExpected) { + if (!statusCodeExpected) statusCodeExpected = 400 + + const req = request(url) + .put(path) + .set('Accept', 'application/json') + + if (token) req.set('Authorization', 'Bearer ' + token) + + req.send(fields).expect(statusCodeExpected, done) +} + +// --------------------------------------------------------------------------- + +module.exports = requestsUtils -- cgit v1.2.3 From 68a3b9f2aacb0225ae8b883b561b144bac339cbd Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 9 Aug 2016 21:44:45 +0200 Subject: Server: delete user with the id and not the username --- server/tests/utils/users.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'server/tests/utils') diff --git a/server/tests/utils/users.js b/server/tests/utils/users.js index ed7a9d672..3b560e409 100644 --- a/server/tests/utils/users.js +++ b/server/tests/utils/users.js @@ -52,7 +52,7 @@ function getUsersList (url, end) { .end(end) } -function removeUser (url, token, username, expectedStatus, end) { +function removeUser (url, userId, accessToken, expectedStatus, end) { if (!end) { end = expectedStatus expectedStatus = 204 @@ -61,9 +61,9 @@ function removeUser (url, token, username, expectedStatus, end) { const path = '/api/v1/users' request(url) - .delete(path + '/' + username) + .delete(path + '/' + userId) .set('Accept', 'application/json') - .set('Authorization', 'Bearer ' + token) + .set('Authorization', 'Bearer ' + accessToken) .expect(expectedStatus) .end(end) } -- cgit v1.2.3 From 5c39adb7313e0696aabb4b71196ab7b0b378c359 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 16 Aug 2016 22:31:45 +0200 Subject: Server: add user list sort/pagination --- server/tests/utils/users.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'server/tests/utils') diff --git a/server/tests/utils/users.js b/server/tests/utils/users.js index 3b560e409..0cf4e4adb 100644 --- a/server/tests/utils/users.js +++ b/server/tests/utils/users.js @@ -6,6 +6,7 @@ const usersUtils = { createUser: createUser, getUserInformation: getUserInformation, getUsersList: getUsersList, + getUsersListPaginationAndSort: getUsersListPaginationAndSort, removeUser: removeUser, updateUser: updateUser } @@ -52,6 +53,20 @@ function getUsersList (url, end) { .end(end) } +function getUsersListPaginationAndSort (url, start, count, sort, end) { + const path = '/api/v1/users' + + request(url) + .get(path) + .query({ start: start }) + .query({ count: count }) + .query({ sort: sort }) + .set('Accept', 'application/json') + .expect(200) + .expect('Content-Type', /json/) + .end(end) +} + function removeUser (url, userId, accessToken, expectedStatus, end) { if (!end) { end = expectedStatus -- cgit v1.2.3 From 1e2564d3927ce4ca4ca9a09930da6da7ebb4e9a1 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Sat, 20 Aug 2016 16:59:25 +0200 Subject: Server: make friends urls come from the request instead of the configuration file --- server/tests/utils/pods.js | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'server/tests/utils') diff --git a/server/tests/utils/pods.js b/server/tests/utils/pods.js index 366492110..9a9148856 100644 --- a/server/tests/utils/pods.js +++ b/server/tests/utils/pods.js @@ -27,13 +27,38 @@ function makeFriends (url, accessToken, expectedStatus, end) { expectedStatus = 204 } + // Which pod makes friends with which pod + const friendsMatrix = { + 'http://localhost:9001': [ + 'http://localhost:9002' + ], + 'http://localhost:9002': [ + 'http://localhost:9003' + ], + 'http://localhost:9003': [ + 'http://localhost:9001' + ], + 'http://localhost:9004': [ + 'http://localhost:9002' + ], + 'http://localhost:9005': [ + 'http://localhost:9001', + 'http://localhost:9004' + ], + 'http://localhost:9006': [ + 'http://localhost:9001', + 'http://localhost:9002', + 'http://localhost:9003' + ] + } const path = '/api/v1/pods/makefriends' // The first pod make friend with the third request(url) - .get(path) + .post(path) .set('Accept', 'application/json') .set('Authorization', 'Bearer ' + accessToken) + .send({ 'urls': friendsMatrix[url] }) .expect(expectedStatus) .end(function (err, res) { if (err) throw err -- cgit v1.2.3 From c4403b29ad4db097af528a7f04eea07e0ed320d0 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Sun, 2 Oct 2016 12:19:02 +0200 Subject: Server: remove useless hash affectations --- server/tests/utils/login.js | 4 ++-- server/tests/utils/miscs.js | 2 +- server/tests/utils/pods.js | 6 +++--- server/tests/utils/requests.js | 6 +++--- server/tests/utils/servers.js | 6 +++--- server/tests/utils/users.js | 12 ++++++------ server/tests/utils/videos.js | 22 +++++++++++----------- 7 files changed, 29 insertions(+), 29 deletions(-) (limited to 'server/tests/utils') diff --git a/server/tests/utils/login.js b/server/tests/utils/login.js index 1a5d75bc4..465564e14 100644 --- a/server/tests/utils/login.js +++ b/server/tests/utils/login.js @@ -3,8 +3,8 @@ const request = require('supertest') const loginUtils = { - login: login, - loginAndGetAccessToken: loginAndGetAccessToken + login, + loginAndGetAccessToken } // ---------------------- Export functions -------------------- diff --git a/server/tests/utils/miscs.js b/server/tests/utils/miscs.js index 5414cd561..4ceff65df 100644 --- a/server/tests/utils/miscs.js +++ b/server/tests/utils/miscs.js @@ -1,7 +1,7 @@ 'use strict' const miscsUtils = { - dateIsValid: dateIsValid + dateIsValid } // ---------------------- Export functions -------------------- diff --git a/server/tests/utils/pods.js b/server/tests/utils/pods.js index 9a9148856..a8551a49d 100644 --- a/server/tests/utils/pods.js +++ b/server/tests/utils/pods.js @@ -3,9 +3,9 @@ const request = require('supertest') const podsUtils = { - getFriendsList: getFriendsList, - makeFriends: makeFriends, - quitFriends: quitFriends + getFriendsList, + makeFriends, + quitFriends } // ---------------------- Export functions -------------------- diff --git a/server/tests/utils/requests.js b/server/tests/utils/requests.js index 410e42c77..b1470814d 100644 --- a/server/tests/utils/requests.js +++ b/server/tests/utils/requests.js @@ -3,9 +3,9 @@ const request = require('supertest') const requestsUtils = { - makePostUploadRequest: makePostUploadRequest, - makePostBodyRequest: makePostBodyRequest, - makePutBodyRequest: makePutBodyRequest + makePostUploadRequest, + makePostBodyRequest, + makePutBodyRequest } // ---------------------- Export functions -------------------- diff --git a/server/tests/utils/servers.js b/server/tests/utils/servers.js index ee7cd8c0a..d62838bc7 100644 --- a/server/tests/utils/servers.js +++ b/server/tests/utils/servers.js @@ -6,9 +6,9 @@ const fork = childProcess.fork const pathUtils = require('path') const serversUtils = { - flushAndRunMultipleServers: flushAndRunMultipleServers, - flushTests: flushTests, - runServer: runServer + flushAndRunMultipleServers, + flushTests, + runServer } // ---------------------- Export functions -------------------- diff --git a/server/tests/utils/users.js b/server/tests/utils/users.js index 0cf4e4adb..2bf9c6e3e 100644 --- a/server/tests/utils/users.js +++ b/server/tests/utils/users.js @@ -3,12 +3,12 @@ const request = require('supertest') const usersUtils = { - createUser: createUser, - getUserInformation: getUserInformation, - getUsersList: getUsersList, - getUsersListPaginationAndSort: getUsersListPaginationAndSort, - removeUser: removeUser, - updateUser: updateUser + createUser, + getUserInformation, + getUsersList, + getUsersListPaginationAndSort, + removeUser, + updateUser } // ---------------------- Export functions -------------------- diff --git a/server/tests/utils/videos.js b/server/tests/utils/videos.js index 90ee9621e..536093db1 100644 --- a/server/tests/utils/videos.js +++ b/server/tests/utils/videos.js @@ -5,17 +5,17 @@ const pathUtils = require('path') const request = require('supertest') const videosUtils = { - getAllVideosListBy: getAllVideosListBy, - getVideo: getVideo, - getVideosList: getVideosList, - getVideosListPagination: getVideosListPagination, - getVideosListSort: getVideosListSort, - removeVideo: removeVideo, - searchVideo: searchVideo, - searchVideoWithPagination: searchVideoWithPagination, - searchVideoWithSort: searchVideoWithSort, - testVideoImage: testVideoImage, - uploadVideo: uploadVideo + getAllVideosListBy, + getVideo, + getVideosList, + getVideosListPagination, + getVideosListSort, + removeVideo, + searchVideo, + searchVideoWithPagination, + searchVideoWithSort, + testVideoImage, + uploadVideo } // ---------------------- Export functions -------------------- -- cgit v1.2.3