mirror of
https://github.com/transloadit/uppy.git
synced 2026-07-23 10:18:40 +00:00
18 lines
558 B
JavaScript
18 lines
558 B
JavaScript
import { describe, expect, it } from '@jest/globals'
|
|
import getFileNameAndExtension from './getFileNameAndExtension.js'
|
|
|
|
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,
|
|
})
|
|
})
|
|
})
|