-
-
Notifications
You must be signed in to change notification settings - Fork 824
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert (Jest) test back to original form and patch it up
- Loading branch information
1 parent
f3a2ff3
commit 6e4d751
Showing
1 changed file
with
7 additions
and
10 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 |
---|---|---|
@@ -1,12 +1,9 @@ | ||
import { useCustomLoader } from '../src/utils/custom-loader.js'; | ||
import { getCustomLoaderByPath } from '../src/utils/custom-loader.js'; | ||
|
||
describe('useCustomLoader', () => { | ||
it.each(['cjs', 'mjs'])( | ||
'can load a custom loader from a file path', | ||
async (extension: string) => { | ||
const loader = await useCustomLoader(`./custom-loader.${extension}`, __dirname); | ||
const result = await loader('some-name', { customLoaderContext: {} }); | ||
expect(result).toEqual('I like turtles'); | ||
}, | ||
); | ||
describe('getCustomLoaderByPath', () => { | ||
it('can load a custom loader from a file path', async () => { | ||
const loader = await getCustomLoaderByPath('./custom-loader.cjs', __dirname); | ||
expect(loader).toBeDefined(); | ||
expect(loader('some-name', { customLoaderContext: {} })).toEqual('I like turtles'); | ||
}); | ||
}); |