diff options
Diffstat (limited to 'shared')
-rw-r--r-- | shared/extra-utils/miscs/miscs.ts | 8 |
1 files changed, 6 insertions, 2 deletions
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 @@ | |||
1 | /* tslint:disable:no-unused-expression */ | 1 | /* tslint:disable:no-unused-expression */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import * as chai from 'chai' |
4 | import { isAbsolute, join } from 'path' | 4 | import { basename, isAbsolute, join, resolve } from 'path' |
5 | import * as request from 'supertest' | 5 | import * as request from 'supertest' |
6 | import * as WebTorrent from 'webtorrent' | 6 | import * as WebTorrent from 'webtorrent' |
7 | import { pathExists, readFile } from 'fs-extra' | 7 | import { pathExists, readFile } from 'fs-extra' |
@@ -34,7 +34,11 @@ function webtorrentAdd (torrent: string, refreshWebTorrent = false) { | |||
34 | 34 | ||
35 | function root () { | 35 | function root () { |
36 | // We are in /miscs | 36 | // We are in /miscs |
37 | return join(__dirname, '..', '..', '..') | 37 | let root = join(__dirname, '..', '..', '..') |
38 | |||
39 | if (basename(root) === 'dist') root = resolve(root, '..') | ||
40 | |||
41 | return root | ||
38 | } | 42 | } |
39 | 43 | ||
40 | async function testImage (url: string, imageName: string, imagePath: string, extension = '.jpg') { | 44 | async function testImage (url: string, imageName: string, imagePath: string, extension = '.jpg') { |