mirror of
https://github.com/transloadit/uppy.git
synced 2026-07-23 10:18:40 +00:00
Co-authored-by: Mikael Finstad <finstaden@gmail.com> Co-authored-by: Nick Rutten <2504906+nickrttn@users.noreply.github.com> Co-authored-by: Murderlon <merlijn@soverin.net> Co-authored-by: Artur Paikin <artur@arturpaikin.com>
18 lines
551 B
TypeScript
18 lines
551 B
TypeScript
import { describe, expect, it } from 'vitest'
|
|
import getFileNameAndExtension from './getFileNameAndExtension.ts'
|
|
|
|
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,
|
|
})
|
|
})
|
|
})
|