mirror of
https://github.com/transloadit/uppy.git
synced 2026-07-24 10:47:44 +00:00
And rewrite all the require calls. ```bash git mv src/utils/* packages/@uppy/utils/src sed -i 's/[./]*\/utils\//@uppy\/utils\/lib\//' src/**/*.js # transform (../)*utils → @uppy/utils ```
12 lines
443 B
JavaScript
12 lines
443 B
JavaScript
const dataURItoFile = require('./dataURItoFile')
|
|
const sampleImageDataURI = require('./sampleImageDataURI')
|
|
|
|
describe('dataURItoFile', () => {
|
|
it('should convert a data uri to a file', () => {
|
|
const file = dataURItoFile(sampleImageDataURI, { name: 'foo.jpg' })
|
|
expect(file instanceof File).toEqual(true)
|
|
expect(file.size).toEqual(9348)
|
|
expect(file.type).toEqual('image/jpeg')
|
|
expect(file.name).toEqual('foo.jpg')
|
|
})
|
|
})
|