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

Commit 198fb1e

Browse files
Make E2E tests ScopeMirror aware (#149)
* Update package.json Add `semver` to dependencies for node version checking. * Update test.js Add version check in breakpoint fetch and compare for determination of local or argument array value lookups. Update `.find` call to use `.matches` property shorthand.
1 parent edcfb04 commit 198fb1e

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

test/e2e/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"license": "Apache-2.0",
1111
"dependencies": {
1212
"lodash": "^3.9.3",
13-
"q": "^1.4.1"
13+
"q": "^1.4.1",
14+
"semver": "^5.3.0"
1415
}
1516
}

test/e2e/test.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ var GoogleAuth = require('google-auth-library');
2828
var _ = require('lodash'); // for _.find. Can't use ES6 yet.
2929
var Q = require('q');
3030
var cluster = require('cluster');
31+
var semver = require('semver');
3132

3233
var DEBUG_API = 'https://clouddebugger.googleapis.com/v2/debugger';
3334
var SCOPES = [
@@ -209,6 +210,7 @@ function runTest() {
209210
return promise;
210211
})
211212
.then(function(body) {
213+
var arg;
212214
console.log('-- results of get breakpoint\n', body);
213215
assert.ok(body.breakpoint, 'should have a breakpoint in the response');
214216
var hit = body.breakpoint;
@@ -219,9 +221,11 @@ function runTest() {
219221
assert.ok(top.function, 'frame should have a function property');
220222
assert.strictEqual(top.function, 'fib');
221223

222-
var arg = _.find(top.arguments, function(a) {
223-
return a.name === 'n';
224-
});
224+
if (semver.satisfies(process.version, '>=4.0')) {
225+
arg = _.find(top.locals, {name: 'n'});
226+
} else {
227+
arg = _.find(top.arguments, {name: 'n'});
228+
}
225229
assert.ok(arg, 'should find the n argument');
226230
assert.strictEqual(arg.value, '10');
227231
console.log('-- checking log point was hit again');

0 commit comments

Comments
 (0)