diff options
author | Chocobozzz <me@florianbigard.com> | 2019-06-13 11:09:38 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-06-13 11:09:38 +0200 |
commit | 1a12f66d631d28a5a58ebbcd274426f2e6e5d203 (patch) | |
tree | edaf546dfc8bcdb55d271111618e65569aa68cc0 /shared/extra-utils/miscs/miscs.ts | |
parent | 4913295f9db1a7b814129d90b159a418cb32bb75 (diff) | |
download | PeerTube-1a12f66d631d28a5a58ebbcd274426f2e6e5d203.tar.gz PeerTube-1a12f66d631d28a5a58ebbcd274426f2e6e5d203.tar.zst PeerTube-1a12f66d631d28a5a58ebbcd274426f2e6e5d203.zip |
Add more CLI tests
Diffstat (limited to 'shared/extra-utils/miscs/miscs.ts')
-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') { |