mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-04-29 04:43:26 +01:00
Add MIME type module
This commit is contained in:
23
test/modules/types/mime_test.js
Normal file
23
test/modules/types/mime_test.js
Normal file
@@ -0,0 +1,23 @@
|
||||
const { assert } = require('chai');
|
||||
|
||||
const MIME = require('../../../js/modules/types/mime');
|
||||
|
||||
|
||||
describe('MIME', () => {
|
||||
describe('isJPEG', () => {
|
||||
it('should return true for `image/jpeg`', () => {
|
||||
assert.isTrue(MIME.isJPEG('image/jpeg'));
|
||||
});
|
||||
|
||||
it('should return true for `image/jpg`', () => {
|
||||
assert.isTrue(MIME.isJPEG('image/jpeg'));
|
||||
});
|
||||
|
||||
['image/gif', 'image/tiff', 'application/json', 0, false, null, undefined]
|
||||
.forEach((value) => {
|
||||
it(`should return false for \`${value}\``, () => {
|
||||
assert.isFalse(MIME.isJPEG(value));
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user