From 891dfbfe68b80ea7733396b5033d4bef11d45d2c Mon Sep 17 00:00:00 2001 From: Wolfram Schneider Date: Thu, 30 Jan 2014 13:59:55 +0000 Subject: [PATCH] indent --- test/spec-dev/parseXML.js | 32 +++++++++++++-------------- test/spec-dev/parseXML.spec.js | 38 +++++++++++++++++---------------- test/spec-sp/mkws-index-jsdom.spec.js | 1 - test/spec/mkws-pazpar2.js | 1 - 4 files changed, 36 insertions(+), 36 deletions(-) diff --git a/test/spec-dev/parseXML.js b/test/spec-dev/parseXML.js index 16c49fd..8c6a32f 100644 --- a/test/spec-dev/parseXML.js +++ b/test/spec-dev/parseXML.js @@ -1,25 +1,25 @@ // Workaround for broken XML parser in node.js/jquery // see https://github.com/coolaj86/node-jquery/issues/29 - var jsdom = require("jsdom"); var DOMParser = require('xmldom').DOMParser; -var xmlstring = 'yes'; +var xmlstring = 'yes'; + +jsdom.env('', +// ["http://code.jquery.com/jquery.js"], -jsdom.env( - '', - // ["http://code.jquery.com/jquery.js"], - function (errors, window) { - // var $ = window.$; - var $ = require('jQuery'); - // override jquery xml parser with external XML lib xmldoc.DOMParser - $.parseXML = function(data) { return new DOMParser().parseFromString(data) };; +function (errors, window) { + // var $ = window.$; + var $ = require('jQuery'); - // parse XML string, extract "process" node and keep the text value of the node - var result = $( $.parseXML(xmlstring)).find("process").text(); + // override jquery xml parser with external XML lib xmldoc.DOMParser + $.parseXML = function (data) { + return new DOMParser().parseFromString(data) + };; - // should output "yes" - console.log("Testing jsdom/xmldom/jQuery $.parseXML() support: " + result); - } -); + // parse XML string, extract "process" node and keep the text value of the node + var result = $($.parseXML(xmlstring)).find("process").text(); + // should output "yes" + console.log("Testing jsdom/xmldom/jQuery $.parseXML() support: " + result); +}); diff --git a/test/spec-dev/parseXML.spec.js b/test/spec-dev/parseXML.spec.js index 40483e0..6827642 100644 --- a/test/spec-dev/parseXML.spec.js +++ b/test/spec-dev/parseXML.spec.js @@ -1,22 +1,22 @@ -describe("jsdom/jQuery suite simple", function() { - it("jsdom test", function() { +describe("jsdom/jQuery suite simple", function () { + it("jsdom test", function () { var jsdom = require("jsdom"); - var $, w; - jsdom.env('

jsdom\'s Homepage

', ["http://code.jquery.com/jquery.js"], function(errors, window) { + var $, w; + jsdom.env('

jsdom\'s Homepage

', ["http://code.jquery.com/jquery.js"], function (errors, window) { console.log("contents of a.the-link:", window.$("a.the-link").text()); - w = window; + w = window; $ = window.$; }); - waitsFor(function() { + waitsFor(function () { if (!w) { - console.log("."); - } + console.log("."); + } return w; }, "window object done", 2 * 1000); - runs(function() { + runs(function () { console.log("got window"); expect(w).toBeDefined(); expect(w.document).toBeDefined(); @@ -24,20 +24,22 @@ describe("jsdom/jQuery suite simple", function() { var xmlstring = "RSS Title"; - var DOMParser = require('xmldom').DOMParser; - var doc = new DOMParser().parseFromString(xmlstring); - console.log("doc: " + doc.documentElement.getAttribute('jsessionId')); + var DOMParser = require('xmldom').DOMParser; + var doc = new DOMParser().parseFromString(xmlstring); + console.log("doc: " + doc.documentElement.getAttribute('jsessionId')); var xmlDoc = doc; // $.parseXML(xml); - var xml = $(xmlDoc); - var title = xml.find("title"); + var xml = $(xmlDoc); + var title = xml.find("title"); - console.log("title: " + $(title).text() ); - $.parseXML = function (data) { return new DOMParser().parseFromString(data) };; + console.log("title: " + $(title).text()); + $.parseXML = function (data) { + return new DOMParser().parseFromString(data) + };; - console.log("parseXML: " + $( $.parseXML( xmlstring)).text() ); + console.log("parseXML: " + $($.parseXML(xmlstring)).text()); - // console.log(w.document); + // console.log(w.document); }) }); diff --git a/test/spec-sp/mkws-index-jsdom.spec.js b/test/spec-sp/mkws-index-jsdom.spec.js index ea22425..fe0dbdf 100644 --- a/test/spec-sp/mkws-index-jsdom.spec.js +++ b/test/spec-sp/mkws-index-jsdom.spec.js @@ -53,4 +53,3 @@ function jsdom_check(file, tags_array, ignore_doctype) { jsdom_check('../examples/htdocs/language.html', [utils.tags.required, utils.tags.optional, utils.tags.optional2]); jsdom_check('../examples/htdocs/mobile.html', [utils.tags.required, utils.tags.optional]); jsdom_check('../examples/htdocs/index.html', [utils.tags.required, utils.tags.optional]); - diff --git a/test/spec/mkws-pazpar2.js b/test/spec/mkws-pazpar2.js index dd7a2ab..d0bf9e8 100644 --- a/test/spec/mkws-pazpar2.js +++ b/test/spec/mkws-pazpar2.js @@ -392,4 +392,3 @@ describe("All tests are done", function () { mkws.jasmine_done = true; }); }); - -- 1.7.10.4