feat: deprecate file.isFileTypeAllowed

use image.isFileTypeAllowed, this function was always meant for images
This commit is contained in:
Barış Soner Uşaklı
2019-09-29 19:53:03 -04:00
parent 2801ffa622
commit ffe3670ff5
6 changed files with 40 additions and 32 deletions

View File

@@ -163,6 +163,13 @@ describe('Upload Controllers', function () {
});
});
it('should fail if file is not an image', function (done) {
image.isFileTypeAllowed(path.join(__dirname, '../test/files/notanimage.png'), function (err) {
assert.equal(err.message, 'Input file contains unsupported image format');
done();
});
});
it('should fail if file is not an image', function (done) {
image.size(path.join(__dirname, '../test/files/notanimage.png'), function (err) {
assert.equal(err.message, 'Input file contains unsupported image format');