aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/utils/miscs/miscs.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2017-12-28 15:25:31 +0100
committerChocobozzz <me@florianbigard.com>2017-12-28 15:25:31 +0100
commit26d21b7867c225d99e0625af51da4643e351d86d (patch)
tree5fa3f0482749eb1001c8b6fad7d9710298c31724 /server/tests/utils/miscs/miscs.ts
parent331128ed3512aa2c1b632e25ac7ac0174bdb3789 (diff)
downloadPeerTube-26d21b7867c225d99e0625af51da4643e351d86d.tar.gz
PeerTube-26d21b7867c225d99e0625af51da4643e351d86d.tar.zst
PeerTube-26d21b7867c225d99e0625af51da4643e351d86d.zip
Improve check users parameters tests
Diffstat (limited to 'server/tests/utils/miscs/miscs.ts')
-rw-r--r--server/tests/utils/miscs/miscs.ts7
1 files changed, 6 insertions, 1 deletions
diff --git a/server/tests/utils/miscs/miscs.ts b/server/tests/utils/miscs/miscs.ts
index 424b0db98..2147a07ff 100644
--- a/server/tests/utils/miscs/miscs.ts
+++ b/server/tests/utils/miscs/miscs.ts
@@ -3,6 +3,10 @@ import { readFile, readdir } from 'fs'
3 3
4let webtorrent = new WebTorrent() 4let webtorrent = new WebTorrent()
5 5
6function immutableAssign <T, U> (target: T, source: U) {
7 return Object.assign<{}, T, U>({}, target, source)
8}
9
6function readFilePromise (path: string) { 10function readFilePromise (path: string) {
7 return new Promise<Buffer>((res, rej) => { 11 return new Promise<Buffer>((res, rej) => {
8 readFile(path, (err, data) => { 12 readFile(path, (err, data) => {
@@ -48,5 +52,6 @@ export {
48 readdirPromise, 52 readdirPromise,
49 dateIsValid, 53 dateIsValid,
50 wait, 54 wait,
51 webtorrentAdd 55 webtorrentAdd,
56 immutableAssign
52} 57}