Skip to content

Commit 5b32578

Browse files
committed
fix: removed onResolve test
1 parent 8f5905d commit 5b32578

File tree

2 files changed

+2
-26
lines changed

2 files changed

+2
-26
lines changed

__tests__/index.test.ts

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -41,30 +41,6 @@ describe('less-loader', () => {
4141
expect(lessLoader).toBeDefined();
4242
});
4343

44-
it('onResolve with watch mode', async () => {
45-
const plugin = lessLoader();
46-
47-
let onResolveCallback: null | Function = null;
48-
const build = {
49-
initialOptions: {
50-
watch: true,
51-
},
52-
onResolve: (opts, callback) => {
53-
onResolveCallback = callback;
54-
},
55-
onStart: vi.fn(),
56-
onEnd: vi.fn(),
57-
onLoad: vi.fn(),
58-
} as unknown as PluginBuild;
59-
60-
await plugin.setup(build);
61-
62-
const path = '/path';
63-
const onResolveResult = onResolveCallback !== null && (onResolveCallback as Function)({ resolveDir: '/', path });
64-
65-
expect(onResolveResult).toMatchSnapshot();
66-
});
67-
6844
it('builds successful', async () => {
6945
const primaryColor = '#ff0000';
7046
const result = await buildLess({

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ export const lessLoader = (options: Less.Options = {}, loaderOptions: LoaderOpti
2323
importer: args.importer,
2424
resolveDir: args.resolveDir,
2525
pluginData: args.pluginData,
26-
})
26+
});
2727
const filePath = pathResolve.path;
2828

2929
return {
3030
path: filePath,
31-
watchFiles: [filePath, ...getLessImports(filePath, (options.paths || []))],
31+
watchFiles: [filePath, ...getLessImports(filePath, options.paths || [])],
3232
};
3333
});
3434

0 commit comments

Comments
 (0)