Fix debugger detection for newer nodejs versions >= 7

This commit is contained in:
blagoev 2017-09-01 17:48:16 +03:00
parent a60e813709
commit 3f3186ee84
1 changed files with 6 additions and 1 deletions

View File

@ -20,6 +20,7 @@
/* eslint-disable no-console */ /* eslint-disable no-console */
'use strict'; 'use strict';
const isNodeProccess = (typeof process === 'object' && process + '' === '[object process]');
const fs = require('fs'); const fs = require('fs');
const path = require('path'); const path = require('path');
@ -28,7 +29,11 @@ const Realm = require('realm');
const RealmTests = require('../js'); const RealmTests = require('../js');
jasmine.DEFAULT_TIMEOUT_INTERVAL = 30000; jasmine.DEFAULT_TIMEOUT_INTERVAL = 30000;
const isDebuggerAttached = typeof v8debug === 'object'; let isDebuggerAttached = typeof v8debug === 'object';
if (!isDebuggerAttached && isNodeProccess) {
isDebuggerAttached = /--debug|--inspect/.test(process.execArgv.join(' '));
}
if (isDebuggerAttached) { if (isDebuggerAttached) {
jasmine.DEFAULT_TIMEOUT_INTERVAL = 3000000; jasmine.DEFAULT_TIMEOUT_INTERVAL = 3000000;
} }