diff options
Diffstat (limited to 'shared/extra-utils/miscs')
-rw-r--r-- | shared/extra-utils/miscs/miscs.ts | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/shared/extra-utils/miscs/miscs.ts b/shared/extra-utils/miscs/miscs.ts index dfd6e28cb..3c8191ae8 100644 --- a/shared/extra-utils/miscs/miscs.ts +++ b/shared/extra-utils/miscs/miscs.ts | |||
@@ -4,7 +4,7 @@ import * as chai from 'chai' | |||
4 | import { basename, dirname, isAbsolute, join, resolve } from 'path' | 4 | import { basename, dirname, 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 { ensureDir, pathExists, readFile } from 'fs-extra' | 7 | import { ensureDir, pathExists, readFile, stat } from 'fs-extra' |
8 | import * as ffmpeg from 'fluent-ffmpeg' | 8 | import * as ffmpeg from 'fluent-ffmpeg' |
9 | 9 | ||
10 | const expect = chai.expect | 10 | const expect = chai.expect |
@@ -130,6 +130,12 @@ async function generateVideoWithFramerate (fps = 60) { | |||
130 | return tempFixturePath | 130 | return tempFixturePath |
131 | } | 131 | } |
132 | 132 | ||
133 | async function getFileSize (path: string) { | ||
134 | const stats = await stat(path) | ||
135 | |||
136 | return stats.size | ||
137 | } | ||
138 | |||
133 | // --------------------------------------------------------------------------- | 139 | // --------------------------------------------------------------------------- |
134 | 140 | ||
135 | export { | 141 | export { |
@@ -138,6 +144,7 @@ export { | |||
138 | areHttpImportTestsDisabled, | 144 | areHttpImportTestsDisabled, |
139 | buildServerDirectory, | 145 | buildServerDirectory, |
140 | webtorrentAdd, | 146 | webtorrentAdd, |
147 | getFileSize, | ||
141 | immutableAssign, | 148 | immutableAssign, |
142 | testImage, | 149 | testImage, |
143 | buildAbsoluteFixturePath, | 150 | buildAbsoluteFixturePath, |