UNPKG

476 BJavaScriptView Raw
1const isPreviewSupported = require('./isPreviewSupported')
2
3describe('isPreviewSupported', () => {
4 it('should return true for any filetypes that browsers can preview', () => {
5 const supported = ['image/jpeg', 'image/gif', 'image/png', 'image/svg', 'image/svg+xml', 'image/bmp', 'image/jpg', 'image/webp', 'image/avif']
6 supported.forEach(ext => {
7 expect(isPreviewSupported(ext)).toEqual(true)
8 })
9 expect(isPreviewSupported('foo')).toEqual(false)
10 })
11})