Skip to content

Commit 2797995

Browse files
committed
test(tegg): fix bundled loader test portability
1 parent 702258d commit 2797995

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

tegg/core/loader/test/ModuleLoaderManifest.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { LoaderFactory } from '../src/index.ts';
1212

1313
describe('core/loader/test/ModuleLoaderManifest.test.ts', () => {
1414
const repoModulePath = path.join(__dirname, './fixtures/modules/module-for-loader');
15+
const toBundlePath = (file: string) => file.split('\\').join('/');
1516

1617
afterEach(() => {
1718
globalThis.__EGG_BUNDLE_MODULE_LOADER__ = undefined;
@@ -88,7 +89,7 @@ describe('core/loader/test/ModuleLoaderManifest.test.ts', () => {
8889
const prototypes = await loader.load();
8990

9091
assert.deepEqual(prototypes.map((proto) => proto.name).sort(), ['BundledRepo', 'BundledService']);
91-
assert.deepEqual(requestedFiles, [serviceFile, repoFile]);
92+
assert.deepEqual(requestedFiles, [serviceFile, repoFile].map(toBundlePath));
9293
assert.equal(PrototypeUtil.getFilePath(BundledService), serviceFile);
9394
assert.equal(PrototypeUtil.getFilePath(BundledRepo), repoFile);
9495
});

tegg/plugin/controller/test/lib/EggControllerLoader.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { afterEach, describe, it, expect } from 'vitest';
55
import { EggControllerLoader } from '../../src/lib/EggControllerLoader.ts';
66
import { getFixtures } from '../utils.ts';
77

8-
describe('plugin/controller/test/lib/EggModuleLoader.test.ts', () => {
8+
describe('plugin/controller/test/lib/EggControllerLoader.test.ts', () => {
99
afterEach(() => {
1010
(globalThis as any).__EGG_BUNDLE_MODULE_LOADER__ = undefined;
1111
});

0 commit comments

Comments
 (0)