Browse Source

test: isolate disposal event mocks

Alvin Unreal 3 weeks ago
parent
commit
3d7518da29
1 changed files with 3 additions and 2 deletions
  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(
 const cleanupOnInstanceDisposed = spyOn(
   MultiplexerSessionManager.prototype,
   MultiplexerSessionManager.prototype,
   'cleanupOnInstanceDisposed',
   'cleanupOnInstanceDisposed',
@@ -77,8 +80,6 @@ afterAll(() => {
   cleanupOnInstanceDisposed.mockRestore();
   cleanupOnInstanceDisposed.mockRestore();
 });
 });
 
 
-const { default: plugin } = await import('./index');
-
 describe('plugin disposal event ordering', () => {
 describe('plugin disposal event ordering', () => {
   test('invalidates task continuations before awaited disposal cleanup', async () => {
   test('invalidates task continuations before awaited disposal cleanup', async () => {
     taskSessionEventCalls = 0;
     taskSessionEventCalls = 0;