From 99d103019c76c517ba607a0fab8022aa6d08ef2e Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 7 Jun 2018 09:48:10 +0200 Subject: Move fixtures in tests/ --- server/tests/utils/miscs/miscs.ts | 4 ++-- server/tests/utils/requests/requests.ts | 2 +- server/tests/utils/users/users.ts | 2 +- server/tests/utils/videos/videos.ts | 2 -- 4 files changed, 4 insertions(+), 6 deletions(-) (limited to 'server/tests/utils') diff --git a/server/tests/utils/miscs/miscs.ts b/server/tests/utils/miscs/miscs.ts index 53cb67baf..5e46004a7 100644 --- a/server/tests/utils/miscs/miscs.ts +++ b/server/tests/utils/miscs/miscs.ts @@ -46,7 +46,7 @@ async function testImage (url: string, imageName: string, imagePath: string, ext const body = res.body - const data = await readFileBufferPromise(join(__dirname, '..', '..', 'api', 'fixtures', imageName + extension)) + const data = await readFileBufferPromise(join(__dirname, '..', '..', 'fixtures', imageName + extension)) const minLength = body.length - ((20 * body.length) / 100) const maxLength = body.length + ((20 * body.length) / 100) @@ -63,7 +63,7 @@ function buildAbsoluteFixturePath (path: string) { return path } - return join(__dirname, '..', '..', 'api', 'fixtures', path) + return join(__dirname, '..', '..', 'fixtures', path) } // --------------------------------------------------------------------------- diff --git a/server/tests/utils/requests/requests.ts b/server/tests/utils/requests/requests.ts index a9b1dff9a..b6195089d 100644 --- a/server/tests/utils/requests/requests.ts +++ b/server/tests/utils/requests/requests.ts @@ -1,5 +1,5 @@ import * as request from 'supertest' -import { buildAbsoluteFixturePath } from '../' +import { buildAbsoluteFixturePath } from '../miscs/miscs' function makeGetRequest (options: { url: string, diff --git a/server/tests/utils/users/users.ts b/server/tests/utils/users/users.ts index d31e57a25..34d50f7ad 100644 --- a/server/tests/utils/users/users.ts +++ b/server/tests/utils/users/users.ts @@ -164,7 +164,7 @@ function updateMyAvatar (options: { if (isAbsolute(options.fixture)) { filePath = options.fixture } else { - filePath = join(__dirname, '..', '..', 'api', 'fixtures', options.fixture) + filePath = join(__dirname, '..', '..', 'fixtures', options.fixture) } return makeUploadRequest({ diff --git a/server/tests/utils/videos/videos.ts b/server/tests/utils/videos/videos.ts index 746b5ca6b..ab0ce12ec 100644 --- a/server/tests/utils/videos/videos.ts +++ b/server/tests/utils/videos/videos.ts @@ -502,8 +502,6 @@ async function completeVideoCheck ( expect(dateIsValid(video.updatedAt)).to.be.true if (attributes.publishedAt) { - console.log(attributes.publishedAt) - console.log(video.publishedAt) expect(video.publishedAt).to.equal(attributes.publishedAt) } -- cgit v1.2.3