aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/extra-utils/miscs
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-06-13 11:09:38 +0200
committerChocobozzz <me@florianbigard.com>2019-06-13 11:09:38 +0200
commit1a12f66d631d28a5a58ebbcd274426f2e6e5d203 (patch)
treeedaf546dfc8bcdb55d271111618e65569aa68cc0 /shared/extra-utils/miscs
parent4913295f9db1a7b814129d90b159a418cb32bb75 (diff)
downloadPeerTube-1a12f66d631d28a5a58ebbcd274426f2e6e5d203.tar.gz
PeerTube-1a12f66d631d28a5a58ebbcd274426f2e6e5d203.tar.zst
PeerTube-1a12f66d631d28a5a58ebbcd274426f2e6e5d203.zip
Add more CLI tests
Diffstat (limited to 'shared/extra-utils/miscs')
-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') {