-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: remove duplicate functions and let .js take precedence (#359)
* feat: remove duplicate functions and let .js take precedence * fix: use entire extensions list to check function precedence * fix: filter out function files based on extension before parsing them * fix: filter out function files based on extension before parsing them * fix: filter out function files based on extension before parsing them
- Loading branch information
1 parent
f217fae
commit bc52282
Showing
2 changed files
with
47 additions
and
7 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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { test, expect } from 'vitest' | ||
|
||
import { removeDuplicatesByExtension } from './finder.js' | ||
|
||
test('filters out any duplicate files based on the extension', () => { | ||
const functions = [ | ||
'file1.js', | ||
'file1.ts', | ||
'file2.tsx', | ||
'file2.jsx', | ||
'file3.tsx', | ||
'file3.js', | ||
'file4.ts', | ||
'file5.ts', | ||
'file5.tsx', | ||
] | ||
const expected = ['file1.js', 'file2.jsx', 'file3.js', 'file4.ts', 'file5.ts'] | ||
|
||
expect(removeDuplicatesByExtension(functions)).toStrictEqual(expected) | ||
}) |
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