数通智联化工云平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

18 lines
558 B

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,
})
})
})