From e1e49e8292c6ab58019f6802f2a4407ba32d35f4 Mon Sep 17 00:00:00 2001 From: Sheel Choksi Date: Fri, 27 Jun 2014 22:19:44 -0700 Subject: [PATCH] Bumping built distribution --- lib/jasmine-core/jasmine-html.js | 10 ++++++++++ lib/jasmine-core/jasmine.js | 4 ++++ 2 files changed, 14 insertions(+) diff --git a/lib/jasmine-core/jasmine-html.js b/lib/jasmine-core/jasmine-html.js index 11cf333a..3679ae73 100644 --- a/lib/jasmine-core/jasmine-html.js +++ b/lib/jasmine-core/jasmine-html.js @@ -49,6 +49,7 @@ jasmineRequire.HtmlReporter = function(j$) { symbols; this.initialize = function() { + clearPrior(); htmlReporterMain = createDom('div', {className: 'jasmine_html-reporter'}, createDom('div', {className: 'banner'}, createDom('a', {className: 'title', href: 'http://jasmine.github.io/', target: '_blank'}), @@ -249,6 +250,15 @@ jasmineRequire.HtmlReporter = function(j$) { return getContainer().querySelector('.jasmine_html-reporter ' + selector); } + function clearPrior() { + // return the reporter + var oldReporter = find(''); + + if(oldReporter) { + getContainer().removeChild(oldReporter); + } + } + function createDom(type, attrs, childrenVarArgs) { var el = createElement(type); diff --git a/lib/jasmine-core/jasmine.js b/lib/jasmine-core/jasmine.js index bec9a137..1d3561bd 100644 --- a/lib/jasmine-core/jasmine.js +++ b/lib/jasmine-core/jasmine.js @@ -687,6 +687,10 @@ getJasmineRequireObj().Env = function(j$) { }; this.expect = function(actual) { + if (!currentSpec) { + throw new Error('\'expect\' was used when there was no current spec, this could be because an asynchronous test timed out'); + } + return currentSpec.expect(actual); };