aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/utils/miscs/miscs.ts
diff options
context:
space:
mode:
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}