Skip to content
This repository was archived by the owner on Apr 3, 2024. It is now read-only.

Commit df8b6f6

Browse files
author
Matt Loring
committed
Regression test for #56 on GH
When testing relative repository paths, we need to ensure that the set breakpoint is hit when the script executes since v8 will accept breakpoints in scripts that are not yet loaded masking an error in selecting the correct script. Fixes #56
1 parent 60ea5a0 commit df8b6f6

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

test/fixtures/a/hello.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
'use strict';
2-
module.exports.hello = function() { console.log('hello world from a'); };
2+
module.exports.hello = function() {
3+
console.log('hello world from a');
4+
};

test/standalone/test-env-relative-repository-path.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ process.env.GCLOUD_DEBUG_REPO_APP_PATH = '/my/project/root';
2222
var assert = require('assert');
2323
var agent = require('../..');
2424
var api;
25+
var h = require('../fixtures/a/hello.js');
2526

2627
describe('repository relative paths', function() {
2728

@@ -44,14 +45,18 @@ describe('repository relative paths', function() {
4445
var bp = {
4546
id: 0,
4647
location: {
47-
line: 1,
48+
line: 3,
4849
path: '/my/project/root/test/fixtures/a/hello.js'
4950
}
5051
};
5152
api.set(bp, function(err) {
5253
assert.ifError(err);
53-
api.clear(bp);
54-
done();
54+
api.wait(bp, function(err) {
55+
assert.ifError(err);
56+
api.clear(bp);
57+
done();
58+
});
59+
process.nextTick(function() { h.hello(); });
5560
});
5661
});
5762

0 commit comments

Comments
 (0)