diff --git a/tests-new/bridge/env/node/source-map.js b/tests-new/bridge/env/node/source-map.js index 17fac1e1..20361866 100644 --- a/tests-new/bridge/env/node/source-map.js +++ b/tests-new/bridge/env/node/source-map.js @@ -1,6 +1,6 @@ /* eslint-disable no-param-reassign */ const Mocha = require('mocha'); -const { parse } = require('stacktrace-parser'); +const ErrorStack = require('error-stack-parser'); const { SourceMapConsumer } = require('source-map'); let bundleFileName = null; @@ -18,21 +18,21 @@ function frameToStr(parsed) { line: parsed.lineNumber, column: parsed.column, }); - return ` at ${name || parsed.methodName} (${source || - parsed.file}:${line || parsed.lineNumber}:${column || parsed.column})`; + return ` at ${name || parsed.functionName || ''} (${source || + parsed.fileName}:${line || parsed.lineNumber}:${column || + parsed.columnNumber})`; } // override mocha fail so we can replace stack traces Runner.prototype.fail = function fail(test, error) { - console.dir(error); const original = error.stack.split('\n'); - const parsed = parse(error.stack); + const parsed = ErrorStack.parse(error); const newStack = [original[0]]; for (let i = 0; i < parsed.length; i++) { - const { file } = parsed[i]; - if (file === bundleFileName) newStack.push(frameToStr(parsed[i])); + const { fileName } = parsed[i]; + if (fileName === bundleFileName) newStack.push(frameToStr(parsed[i])); else newStack.push(original[i + 1]); } diff --git a/tests-new/bridge/env/node/vm.js b/tests-new/bridge/env/node/vm.js index 5b4e6157..22523f5c 100644 --- a/tests-new/bridge/env/node/vm.js +++ b/tests-new/bridge/env/node/vm.js @@ -71,7 +71,6 @@ async function getBundle(request) { parsedUrl.query.inlineSourceMap = true; delete parsedUrl.search; - console.log(url.format(parsedUrl)); return downloadBundle(url.format(parsedUrl)); } @@ -82,7 +81,6 @@ module.exports = { async message(request) { const { method } = request; - // console.log(request.method); switch (method) { case PREPARE: coverage.collect(); diff --git a/tests-new/firebase/modules/auth/User.js b/tests-new/firebase/modules/auth/User.js index e509bb94..b6cc0c7f 100644 --- a/tests-new/firebase/modules/auth/User.js +++ b/tests-new/firebase/modules/auth/User.js @@ -32,6 +32,7 @@ export default class User { constructor(auth: Auth, user: NativeUser) { this._auth = auth; this._user = user; + throw new Error('Woops') } /** diff --git a/tests-new/package-lock.json b/tests-new/package-lock.json index a192cc33..13c1c249 100644 --- a/tests-new/package-lock.json +++ b/tests-new/package-lock.json @@ -10851,21 +10851,6 @@ "urix": "0.1.0" } }, - "source-map-support": { - "version": "0.5.4", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.4.tgz", - "integrity": "sha512-PETSPG6BjY1AHs2t64vS2aqAgu6dMIMXJULWFBGbh2Gr8nVLbCFDo6i/RMMvviIQ2h1Z8+5gQhVKSn2je9nmdg==", - "requires": { - "source-map": "0.6.1" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" - } - } - }, "source-map-url": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", diff --git a/tests-new/package.json b/tests-new/package.json index c4039624..d99c8de9 100755 --- a/tests-new/package.json +++ b/tests-new/package.json @@ -21,6 +21,7 @@ "chalk": "^2.3.2", "deeps": "^1.4.4", "detox": "^7.2.0", + "error-stack-parser": "^2.0.1", "istanbul-lib-coverage": "^1.2.0", "mocha": "^4.0.1", "react": "^16.2.0", @@ -30,7 +31,6 @@ "should-sinon": "0.0.6", "sinon": "^4.4.8", "source-map": "^0.7.2", - "stacktrace-parser": "^0.1.4", "ws": "^5.1.0" }, "devDependencies": {