aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared
diff options
context:
space:
mode:
Diffstat (limited to 'shared')
-rw-r--r--shared/extra-utils/miscs/miscs.ts8
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
3import * as chai from 'chai' 3import * as chai from 'chai'
4import { isAbsolute, join } from 'path' 4import { basename, isAbsolute, join, resolve } from 'path'
5import * as request from 'supertest' 5import * as request from 'supertest'
6import * as WebTorrent from 'webtorrent' 6import * as WebTorrent from 'webtorrent'
7import { pathExists, readFile } from 'fs-extra' 7import { pathExists, readFile } from 'fs-extra'
@@ -34,7 +34,11 @@ function webtorrentAdd (torrent: string, refreshWebTorrent = false) {
34 34
35function root () { 35function 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
40async function testImage (url: string, imageName: string, imagePath: string, extension = '.jpg') { 44async function testImage (url: string, imageName: string, imagePath: string, extension = '.jpg') {