From 1a12f66d631d28a5a58ebbcd274426f2e6e5d203 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 13 Jun 2019 11:09:38 +0200 Subject: Add more CLI tests --- shared/extra-utils/miscs/miscs.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'shared/extra-utils') diff --git a/shared/extra-utils/miscs/miscs.ts b/shared/extra-utils/miscs/miscs.ts index d1ffb7be4..fb6430e4f 100644 --- a/shared/extra-utils/miscs/miscs.ts +++ b/shared/extra-utils/miscs/miscs.ts @@ -1,7 +1,7 @@ /* tslint:disable:no-unused-expression */ import * as chai from 'chai' -import { isAbsolute, join } from 'path' +import { basename, isAbsolute, join, resolve } from 'path' import * as request from 'supertest' import * as WebTorrent from 'webtorrent' import { pathExists, readFile } from 'fs-extra' @@ -34,7 +34,11 @@ function webtorrentAdd (torrent: string, refreshWebTorrent = false) { function root () { // We are in /miscs - return join(__dirname, '..', '..', '..') + let root = join(__dirname, '..', '..', '..') + + if (basename(root) === 'dist') root = resolve(root, '..') + + return root } async function testImage (url: string, imageName: string, imagePath: string, extension = '.jpg') { -- cgit v1.2.3