Skip to content
This repository has been archived by the owner on Dec 6, 2022. It is now read-only.

Commit

Permalink
Merge pull request #601 from digeff/new_int_test
Browse files Browse the repository at this point in the history
Added new integration test
  • Loading branch information
roblourens authored Feb 19, 2018
2 parents 02c240f + a36209d commit 3d0b4c0
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
23 changes: 23 additions & 0 deletions test/int/breakOnLoad.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 })
});
});
}

Expand Down
1 change: 1 addition & 0 deletions testdata/breakOnLoad_javaScript/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<html>
<head>
<script src="src/script.js"></script>
<script src="src/script2.js"></script>
</head>
<body>
<h1>testdata/breakOnLoad_javaScript</h1>
Expand Down
7 changes: 7 additions & 0 deletions testdata/breakOnLoad_javaScript/src/script2.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
document.write("Script2.js file"); console.log("Hi2");
var a = 1;
var b = 1; fun2();

function fun2() {
return true;
}

0 comments on commit 3d0b4c0

Please sign in to comment.