diff --git a/test/int/breakOnLoad.test.ts b/test/int/breakOnLoad.test.ts index 0940d50e..779b68a0 100644 --- a/test/int/breakOnLoad.test.ts +++ b/test/int/breakOnLoad.test.ts @@ -156,6 +156,29 @@ function runCommonTests(breakOnLoadStrategy: string) { await dc.hitBreakpointUnverified({ url, webRoot: testProjectRoot }, { path: scriptPath, line: bpLine, column: bpCol }); }); + + test('Hits breakpoints on the first line of two scripts', async () => { + const testProjectRoot = path.join(DATA_ROOT, 'breakOnLoad_javaScript'); + const scriptPath = path.join(testProjectRoot, 'src/script.js'); + const script2Path = path.join(testProjectRoot, 'src/script2.js'); + + server = createServer({ root: testProjectRoot }); + server.listen(7890); + + const url = 'http://localhost:7890/index.html'; + + const bpLine = 1; + const bpCol = 1; + + await dc.hitBreakpointUnverified({ url, webRoot: testProjectRoot }, { path: scriptPath, line: bpLine, column: bpCol }); + await dc.setBreakpointsRequest({ + lines: [bpLine], + breakpoints: [{ line: bpLine, column: bpCol }], + source: { path: script2Path } + }); + await dc.continueRequest(); + await dc.assertStoppedLocation('breakpoint', { path: script2Path, line: bpLine, column: bpCol }) + }); }); } diff --git a/testdata/breakOnLoad_javaScript/index.html b/testdata/breakOnLoad_javaScript/index.html index 0ecbdb8e..618556b3 100644 --- a/testdata/breakOnLoad_javaScript/index.html +++ b/testdata/breakOnLoad_javaScript/index.html @@ -2,6 +2,7 @@
+