Skip to content

Commit

Permalink
fix: disable dump in preload
Browse files Browse the repository at this point in the history
  • Loading branch information
gxkl committed Oct 23, 2024
1 parent 1a10a17 commit fccebe2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions standalone/standalone/src/Runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ export class Runner {
await EggModuleLoader.preLoad(moduleReferences, {
baseDir: cwd,
logger: console,
dump: false,
});
}

Expand Down
4 changes: 4 additions & 0 deletions standalone/standalone/test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,9 @@ describe('standalone/standalone/test/index.test.ts', () => {
let Foo;

beforeEach(() => {
mm.restore();
mm.spy(ModuleDescriptorDumper, 'dump');

delete require.cache[require.resolve(path.join(fixturePath, './foo'))];
// eslint-disable-next-line @typescript-eslint/no-var-requires
Foo = require(path.join(fixturePath, './foo')).Foo;
Expand All @@ -315,6 +318,7 @@ describe('standalone/standalone/test/index.test.ts', () => {
'postInject',
'init',
]);
assert.equal((ModuleDescriptorDumper.dump as any).called, 1);
});
});
});

0 comments on commit fccebe2

Please sign in to comment.