Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Regression Test for RNW:9662 #10523

Merged
merged 1 commit into from
Sep 8, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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();
}
});