]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/utils/miscs/miscs.ts
Add ability to update some configuration keys
[github/Chocobozzz/PeerTube.git] / server / tests / utils / miscs / miscs.ts
index 2c51d1f0a248b68c65943af181e790dcd0ee05e2..2aac37791ac5d7673ca4cbf382187ffdccf147b2 100644 (file)
@@ -1,5 +1,4 @@
 import * as WebTorrent from 'webtorrent'
-import { readFile, readdir } from 'fs'
 
 let webtorrent = new WebTorrent()
 
@@ -7,26 +6,6 @@ function immutableAssign <T, U> (target: T, source: U) {
   return Object.assign<{}, T, U>({}, target, source)
 }
 
-function readFilePromise (path: string) {
-  return new Promise<Buffer>((res, rej) => {
-    readFile(path, (err, data) => {
-      if (err) return rej(err)
-
-      return res(data)
-    })
-  })
-}
-
-function readdirPromise (path: string) {
-  return new Promise<string[]>((res, rej) => {
-    readdir(path, (err, files) => {
-      if (err) return rej(err)
-
-      return res(files)
-    })
-  })
-}
-
   // Default interval -> 5 minutes
 function dateIsValid (dateString: string, interval = 300000) {
   const dateToCheck = new Date(dateString)
@@ -48,8 +27,6 @@ function webtorrentAdd (torrent: string, refreshWebTorrent = false) {
 // ---------------------------------------------------------------------------
 
 export {
-  readFilePromise,
-  readdirPromise,
   dateIsValid,
   wait,
   webtorrentAdd,