From 8d46e210b91ed1521f6692a2cf35f60740c0ace6 Mon Sep 17 00:00:00 2001 From: Chirayu Krishnappa Date: Wed, 21 May 2014 12:21:29 -0700 Subject: [PATCH] feat(runner): support sourcemaps in spec files This feature allows folks who are generating their spec files from a different language to see stack traces that use the line numbers from their sources before translation. This commit introduces a dependency on the `source-map-support` library. For general information about sourcemaps, refer: - http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/ - https://github.com/evanw/node-source-map-support - https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/view --- lib/runner.js | 3 +++ package.json | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/runner.js b/lib/runner.js index 08b6c3f52..fc722da4e 100644 --- a/lib/runner.js +++ b/lib/runner.js @@ -349,6 +349,9 @@ Runner.prototype.setupGlobals_ = function(driver) { global.$$ = browser.$$; global.element = browser.element; global.by = global.By = protractor.By; + + // Enable sourcemap support for stack traces. + require('source-map-support').install(); }; /** diff --git a/package.json b/package.json index cbd7be8c6..a844df3ee 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,8 @@ "adm-zip": "0.4.4", "optimist": "~0.6.0", "q": "1.0.0", - "lodash": "~2.4.1" + "lodash": "~2.4.1", + "source-map-support": "~0.2.6" }, "devDependencies": { "expect.js": "~0.2.0",