-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: invalid id for cts, mts, cjs, mjs files, node paths (#318)
* better error messages * fix: invalid id for cts, mts, cjs, mjs files
- Loading branch information
Showing
4 changed files
with
35 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -91,3 +91,7 @@ dist | |
# Yarn files | ||
.yarn/install-state.gz | ||
.yarn/build-state.yml | ||
|
||
.yalc | ||
|
||
yalc.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
// | ||
// }) | ||
}) |