Просмотр исходного кода

test: isolate disposal event mocks

Alvin Unreal 2 недель назад
Родитель
Сommit
3d7518da29
1 измененных файлов с 3 добавлено и 2 удалено
  1. 3 2
      src/index.event.test.ts

+ 3 - 2
src/index.event.test.ts

@@ -61,6 +61,9 @@ mock.module('./hooks', () => ({
   },
 }));
 
+const { default: plugin } = await import('./index');
+mock.restore();
+
 const cleanupOnInstanceDisposed = spyOn(
   MultiplexerSessionManager.prototype,
   'cleanupOnInstanceDisposed',
@@ -77,8 +80,6 @@ afterAll(() => {
   cleanupOnInstanceDisposed.mockRestore();
 });
 
-const { default: plugin } = await import('./index');
-
 describe('plugin disposal event ordering', () => {
   test('invalidates task continuations before awaited disposal cleanup', async () => {
     taskSessionEventCalls = 0;