const minLength = body.length - ((30 * body.length) / 100)
const maxLength = body.length + ((30 * body.length) / 100)
- expect(data.length).to.be.above(minLength, "the generated image is way smaller than the recorded fixture")
- expect(data.length).to.be.below(maxLength, "the generated image is way larger than the recorded fixture")
+ expect(data.length).to.be.above(minLength, 'the generated image is way smaller than the recorded fixture')
+ expect(data.length).to.be.below(maxLength, 'the generated image is way larger than the recorded fixture')
+}
+
+async function testFileExistsOrNot (server: { internalServerNumber: number }, directory: string, filePath: string, exist: boolean) {
+ const base = buildServerDirectory(server, directory)
+
+ expect(await pathExists(join(base, filePath))).to.equal(exist)
}
function isGithubCI () {
testImage,
isGithubCI,
buildAbsoluteFixturePath,
+ testFileExistsOrNot,
root,
generateHighBitrateVideo,
generateVideoWithFramerate