aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/utils/miscs
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/utils/miscs')
-rw-r--r--server/tests/utils/miscs/miscs.ts5
1 files changed, 4 insertions, 1 deletions
diff --git a/server/tests/utils/miscs/miscs.ts b/server/tests/utils/miscs/miscs.ts
index 24cbf59ca..53cb67baf 100644
--- a/server/tests/utils/miscs/miscs.ts
+++ b/server/tests/utils/miscs/miscs.ts
@@ -1,10 +1,12 @@
1/* tslint:disable:no-unused-expression */ 1/* tslint:disable:no-unused-expression */
2 2
3import * as chai from 'chai'
3import { isAbsolute, join } from 'path' 4import { isAbsolute, join } from 'path'
4import * as request from 'supertest' 5import * as request from 'supertest'
5import * as WebTorrent from 'webtorrent' 6import * as WebTorrent from 'webtorrent'
6import { readFileBufferPromise } from '../../../helpers/core-utils' 7import { readFileBufferPromise } from '../../../helpers/core-utils'
7 8
9const expect = chai.expect
8let webtorrent = new WebTorrent() 10let webtorrent = new WebTorrent()
9 11
10function immutableAssign <T, U> (target: T, source: U) { 12function immutableAssign <T, U> (target: T, source: U) {
@@ -48,7 +50,8 @@ async function testImage (url: string, imageName: string, imagePath: string, ext
48 const minLength = body.length - ((20 * body.length) / 100) 50 const minLength = body.length - ((20 * body.length) / 100)
49 const maxLength = body.length + ((20 * body.length) / 100) 51 const maxLength = body.length + ((20 * body.length) / 100)
50 52
51 return data.length > minLength && data.length < maxLength 53 expect(data.length).to.be.above(minLength)
54 expect(data.length).to.be.below(maxLength)
52 } else { 55 } else {
53 console.log('Do not test images. Enable it by setting NODE_TEST_IMAGE env variable.') 56 console.log('Do not test images. Enable it by setting NODE_TEST_IMAGE env variable.')
54 return true 57 return true