X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=test%2Fspec%2Fmkws-index-jsdom.spec.js;h=8106441f6994e9e76c69f881f89399e84e70caca;hb=7d1ed643971b93a0b596d82e65ce880e124fbcf4;hp=5b49cf31b08d26e2f91f9bc59cee57846b129272;hpb=f3dd4da433bb1c8cb0fff974d2eb0b699da631a5;p=mkws-moved-to-github.git diff --git a/test/spec/mkws-index-jsdom.spec.js b/test/spec/mkws-index-jsdom.spec.js index 5b49cf3..8106441 100644 --- a/test/spec/mkws-index-jsdom.spec.js +++ b/test/spec/mkws-index-jsdom.spec.js @@ -13,41 +13,41 @@ var utils = require("./mkws_utils.js"); * */ -function jsdom_check (file, tags_array, ignore_doctype) { - var html = fs.readFileSync(file, "utf-8"); - var tags = utils.flat_list(tags_array); +function jsdom_check(file, tags_array, ignore_doctype) { + var html = fs.readFileSync(file, "utf-8"); + var tags = utils.flat_list(tags_array); - describe("index-full.html jsdom + jquery for " + file, function() { - var window = require('jsdom').jsdom(html, null, { - FetchExternalResources: false, - ProcessExternalResources: false, - MutationEvents: false, - QuerySelector: false - }).createWindow(); + describe("index-full.html jsdom + jquery for " + file, function () { + var window = require('jsdom').jsdom(html, null, { + FetchExternalResources: false, + ProcessExternalResources: false, + MutationEvents: false, + QuerySelector: false + }).createWindow(); - /* apply jquery to the window */ - var $ = require('jquery').create(window); + /* apply jquery to the window */ + var $ = require('jquery').create(window); - it("html jquery test", function() { - expect(html).toBeDefined(); + it("html jquery test", function () { + expect(html).toBeDefined(); - expect($("body").length == 0).toEqual(false); - expect($("body").length == 1).toEqual(true); - expect($("head").length == 1).toEqual(true); + expect($("body").length == 0).toEqual(false); + expect($("body").length == 1).toEqual(true); + expect($("head").length == 1).toEqual(true); - for(var i = 0; i < tags.length; i++) { - expect($("#" + tags[i]).length == 1).toEqual(true); - } - }); + for (var i = 0; i < tags.length; i++) { + expect($("#" + tags[i]).length == 1).toEqual(true); + } + }); - it("html jquery fail test", function() { - expect(html).toBeDefined(); + it("html jquery fail test", function () { + expect(html).toBeDefined(); - expect($("body_does_not_exists").length == 1).toEqual(false); - expect($("#body_does_not_exists").length == 1).toEqual(false); + expect($("body_does_not_exists").length == 1).toEqual(false); + expect($("#body_does_not_exists").length == 1).toEqual(false); + }); }); - }); } jsdom_check('../examples/htdocs/index-full.html', [utils.tags.required, utils.tags.optional, utils.tags.optional2]);