mirror of
https://github.com/transloadit/uppy.git
synced 2026-07-23 10:18:40 +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 ```
17 lines
505 B
JavaScript
17 lines
505 B
JavaScript
const getFileNameAndExtension = require('./getFileNameAndExtension')
|
|
|
|
describe('getFileNameAndExtension', () => {
|
|
it('should return the filename and extension as an array', () => {
|
|
expect(getFileNameAndExtension('fsdfjodsuf23rfw.jpg')).toEqual({
|
|
name: 'fsdfjodsuf23rfw',
|
|
extension: 'jpg'
|
|
})
|
|
})
|
|
|
|
it('should handle invalid filenames', () => {
|
|
expect(getFileNameAndExtension('fsdfjodsuf23rfw')).toEqual({
|
|
name: 'fsdfjodsuf23rfw',
|
|
extension: undefined
|
|
})
|
|
})
|
|
})
|