1
0
mirror of https://github.com/oceanprotocol/commons.git synced 2023-03-15 18:03:00 +01:00
commons/client/src/utils/cleanupContentType.test.ts
2019-05-27 19:37:51 +02:00

19 lines
614 B
TypeScript

import cleanupContentType from './cleanupContentType'
describe('getFileCompression', () => {
it('outputs known compression', async () => {
const compression = await cleanupContentType('application/zip')
expect(compression).toBe('zip')
})
it('outputs known x- compression', async () => {
const compression = await cleanupContentType('application/x-gtar')
expect(compression).toBe('gtar')
})
it('pass through unknown compression', async () => {
const compression = await cleanupContentType('blabla')
expect(compression).toBe('blabla')
})
})