From 802d503a3b1055d98f36d027f12fa125013d6352 Mon Sep 17 00:00:00 2001 From: Vojta Jina Date: Tue, 17 Dec 2013 17:02:17 -0800 Subject: [PATCH] fix: strip jasmine from stack traces Since Karma uses SHAs rather than timestamps. --- src/adapter.js | 2 +- test/adapter.spec.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/adapter.js b/src/adapter.js index 5562000..0c52fda 100644 --- a/src/adapter.js +++ b/src/adapter.js @@ -10,7 +10,7 @@ var formatFailedStep = function(step) { } // remove jasmine stack entries - return stack.replace(/\n.+jasmine\.js\?\d*\:.+(?=(\n|$))/g, ''); + return stack.replace(/\n.+jasmine\.js\?\w*\:.+(?=(\n|$))/g, ''); } return message; diff --git a/test/adapter.spec.js b/test/adapter.spec.js index 19380c3..565e637 100644 --- a/test/adapter.spec.js +++ b/test/adapter.spec.js @@ -148,8 +148,8 @@ describe('jasmine adapter', function() { message: "Error: Expected 'function' to be 'fxunction'", trace: { stack: "Error: Expected 'function' to be 'fxunction'.\n" + - " at new (http://localhost:8080/lib/jasmine/jasmine.js?123412234:102:32)\n" + - " at [object Object].toBe (http://localhost:8080/lib/jasmine/jasmine.js?123:1171:29)\n" + + " at new (http://localhost:8080/lib/jasmine/jasmine.js?123412asd:102:32)\n" + + " at [object Object].toBe (http://localhost:8080/lib/jasmine/jasmine.js?12sd3:1171:29)\n" + " at [object Object]. (http://localhost:8080/test/resourceSpec.js:2:3)\n" + " at [object Object].execute (http://localhost:8080/lib/jasmine/jasmine.js?123:1001:15)" }