diff --git a/packages/load/tests/use-custom-loader.spec.ts b/packages/load/tests/use-custom-loader.spec.ts index 9552e1977c9..9da3c91f91a 100644 --- a/packages/load/tests/use-custom-loader.spec.ts +++ b/packages/load/tests/use-custom-loader.spec.ts @@ -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'); + }); });