From 0508566887a509d59ef64acdc2e5ff016d31fe9e Mon Sep 17 00:00:00 2001 From: Michael Gao Date: Wed, 11 Oct 2017 17:18:45 -0700 Subject: [PATCH] Fix node 4/6 on windows --- src/agent/debuglet.ts | 1 + test/test-debuglet.ts | 14 +++++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/agent/debuglet.ts b/src/agent/debuglet.ts index b899aa185..2999f8f65 100644 --- a/src/agent/debuglet.ts +++ b/src/agent/debuglet.ts @@ -213,6 +213,7 @@ export class Debuglet extends EventEmitter { 'traces. The above warning will not affect the debug agent.'); } }); + const that = this; const stat = promisify(fs.stat); diff --git a/test/test-debuglet.ts b/test/test-debuglet.ts index cec72ce6c..9a4c5585d 100644 --- a/test/test-debuglet.ts +++ b/test/test-debuglet.ts @@ -337,12 +337,16 @@ describe('Debuglet', function() { assert.equal((debuglet.debuggee_ as Debuggee).project, projectId); console.log = oldLog; const arch = process.arch; - if (arch === 'ia32' || arch === 'x86') { - assert(logText.includes('The current debug agent does not use ' - + 'Inspector async stack traces')); + console.log(process); + if (parseFloat(process.version) > 8 && + (arch === 'ia32' || arch === 'x86')) { + assert(logText.includes( + 'The current debug agent does not use ' + + 'Inspector async stack traces')); } else { - assert(!logText.includes('The current debug agent does not use ' - + 'Inspector async stack traces')); + assert(!logText.includes( + 'The current debug agent does not use ' + + 'Inspector async stack traces')); } debuglet.stop(); scope.done();