Return-Path: X-Original-To: apmail-cordova-commits-archive@www.apache.org Delivered-To: apmail-cordova-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 67A2B108F6 for ; Fri, 13 Dec 2013 16:02:45 +0000 (UTC) Received: (qmail 59280 invoked by uid 500); 13 Dec 2013 16:02:44 -0000 Delivered-To: apmail-cordova-commits-archive@cordova.apache.org Received: (qmail 59265 invoked by uid 500); 13 Dec 2013 16:02:43 -0000 Mailing-List: contact commits-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cordova.apache.org Delivered-To: mailing list commits@cordova.apache.org Received: (qmail 59238 invoked by uid 99); 13 Dec 2013 16:02:42 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Dec 2013 16:02:42 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 6BB298B7FDA; Fri, 13 Dec 2013 16:02:42 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: mmocny@apache.org To: commits@cordova.apache.org Date: Fri, 13 Dec 2013 16:02:44 -0000 Message-Id: <3ee54f447064433ca7513637ce0685a7@git.apache.org> In-Reply-To: <7016e5c2e9e643849eb0e9278a58069c@git.apache.org> References: <7016e5c2e9e643849eb0e9278a58069c@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [3/4] git commit: Updating the way we create jasmineInterface Updating the way we create jasmineInterface Project: http://git-wip-us.apache.org/repos/asf/cordova-labs/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-labs/commit/42e92abd Tree: http://git-wip-us.apache.org/repos/asf/cordova-labs/tree/42e92abd Diff: http://git-wip-us.apache.org/repos/asf/cordova-labs/diff/42e92abd Branch: refs/heads/cdvtest Commit: 42e92abdb54da05a7a46c3c63bcfbd90d17bb394 Parents: 52ff719 Author: Michal Mocny Authored: Fri Dec 6 14:38:23 2013 -0500 Committer: Michal Mocny Committed: Fri Dec 13 09:59:34 2013 -0500 ---------------------------------------------------------------------- cordova-plugin-test-framework/www/test.js | 75 ++++++++------------------ 1 file changed, 23 insertions(+), 52 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-labs/blob/42e92abd/cordova-plugin-test-framework/www/test.js ---------------------------------------------------------------------- diff --git a/cordova-plugin-test-framework/www/test.js b/cordova-plugin-test-framework/www/test.js index 56bc407..68b3108 100644 --- a/cordova-plugin-test-framework/www/test.js +++ b/cordova-plugin-test-framework/www/test.js @@ -50,63 +50,34 @@ Object.defineProperty(exports, "log", { (function() { var jasmine, - jasmineEnv, jasmineInterface; /******************************************************************************/ exports.initForAutoTests = function(jasmine_) { jasmine = jasmine_; - jasmineEnv = jasmine.getEnv(); - jasmineInterface = { - describe: function(description, specDefinitions) { - return jasmineEnv.describe(description, specDefinitions); - }, - - xdescribe: function(description, specDefinitions) { - return jasmineEnv.xdescribe(description, specDefinitions); - }, - - it: function(desc, func) { - return jasmineEnv.it(desc, func); - }, - - xit: function(desc, func) { - return jasmineEnv.xit(desc, func); - }, - - beforeEach: function(beforeEachFunction) { - return jasmineEnv.beforeEach(beforeEachFunction); - }, - - afterEach: function(afterEachFunction) { - return jasmineEnv.afterEach(afterEachFunction); - }, - - expect: function(actual) { - return jasmineEnv.expect(actual); - }, - - pending: function() { - return jasmineEnv.pending(); - }, - - addMatchers: function(matchers) { - return jasmineEnv.addMatchers(matchers); - }, - - spyOn: function(obj, methodName) { - return jasmineEnv.spyOn(obj, methodName); - }, - - clock: jasmineEnv.clock, - - jsApiReporter: new jasmine.JsApiReporter({ - timer: new jasmine.Timer() - }), - - jasmine: jasmine, - }; + jasmineInterface = {}; + + var jasmineEnv = jasmine.getEnv(); + + // Fill in jasmineInterface + var jasmine_functions = ['describe', + 'xdescribe', + 'it', + 'xit', + 'beforeEach', + 'afterEach', + 'expect', + 'pending', + 'addMatchers', + 'spyOn']; + jasmine_functions.forEach(function(fn) { + jasmineInterface[fn] = jasmineEnv[fn].bind(jasmineEnv); + }); + jasmineInterface.clock = jasmineEnv.clock; + jasmineInterface.jsApiReporter = new jasmine.JsApiReporter({ timer: new jasmine.Timer() }); + jasmineInterface.jasmine = jasmine; + jasmineInterface.log = exports.log; jasmineEnv.addReporter(jasmineInterface.jsApiReporter); }; @@ -114,7 +85,7 @@ exports.initForAutoTests = function(jasmine_) { /******************************************************************************/ exports.runAutoTests = function() { - jasmineEnv.execute(); + jasmine.getEnv().execute(); }; /******************************************************************************/