mirror of
https://github.com/sern-handler/handler
synced 2026-06-06 01:16:55 +00:00
fix: invalid id for cts, mts, cjs, mjs files, node paths (#318)
* better error messages * fix: invalid id for cts, mts, cjs, mjs files
This commit is contained in:
23
test/core/module-loading.test.ts
Normal file
23
test/core/module-loading.test.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import { describe, it, expect } from 'vitest'
|
||||
import { faker } from '@faker-js/faker'
|
||||
import * as Files from '../../src/core/module-loading'
|
||||
describe('module-loading', () => {
|
||||
it('should properly extract filename from file, nested once', () => {
|
||||
const extension = faker.system.fileExt()
|
||||
const name = faker.system.fileName({ extensionCount: 0 })
|
||||
const filename = Files.fmtFileName(name+'.'+extension);
|
||||
expect(filename).toBe(name)
|
||||
})
|
||||
|
||||
|
||||
// todo: handle commands with multiple extensions
|
||||
// it('should properly extract filename from file, nested multiple', () => {
|
||||
// const extension = faker.system.fileExt()
|
||||
// const extension2 = faker.system.fileExt()
|
||||
// const name = faker.system.fileName({ extensionCount: 0 })
|
||||
// const filename = Files.fmtFileName(name+'.'+extension+'.'+extension2);
|
||||
// console.log(filename, name)
|
||||
// expect(filename).toBe(name)
|
||||
//
|
||||
// })
|
||||
})
|
||||
Reference in New Issue
Block a user