Skip to content

Commit

Permalink
add regression test for RNW:9662 (#10523)
Browse files Browse the repository at this point in the history
  • Loading branch information
aeulitz committed Sep 8, 2022
1 parent d48085b commit f96ab5e
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions packages/debug-test/DebuggingFeatures.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,3 +239,43 @@ test('set, remove breakpoint', async () => {
await settings.restore();
}
});

// Regression test for the fix for RNW:9662 (https://github.com/microsoft/react-native-windows/issues/9662,
// this test would fail prior to the fix).
test('reload after continue', async () => {
testLog.message(`executing 'pause, resume' test on PID ${pid}`);

const settings = await PlaygroundDebugSettings.set({
webDebugger: false,
directDebugging: true,
jsEngine: 'Hermes',
});
try {
const isBundleServed0 = metro.isBundleServed('debugTest01');
await loadPackage('Samples\\debugTest01', isBundleServed0);

const debugTargets = await getDebugTargets();
const dbg = new CDPDebugger(debugTargets[0].webSocketDebuggerUrl);

await dbg.debuggerEnable();

const pausedEvent = dbg.expectEvent('paused');
await dbg.debuggerPause();
await pausedEvent;

const resumedEvent = dbg.expectEvent('resumed');
await dbg.debuggerResume();
await resumedEvent;

const isBundleServed1 = metro.isBundleServed('debugTest01');

// without the fix, this re-load would hang
await loadPackage('Samples\\debugTest01', isBundleServed1);

await dbg.checkOutstandingResponses(3000);

dbg.close();
} finally {
await settings.restore();
}
});

0 comments on commit f96ab5e

Please sign in to comment.