X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=test%2Fspec%2Fjquery.spec.js;h=2617b3df1ed01eba4569bde61c10000dfc4551c2;hb=7f22fb422b50e6020c9c9566bdc34a97c247abd0;hp=107094d26df0475f4ed5add5a1c8709e18b7cb6e;hpb=159ab9e0a0b46fc867c1cb2ae6381920b433abb6;p=mkws-moved-to-github.git diff --git a/test/spec/jquery.spec.js b/test/spec/jquery.spec.js index 107094d..2617b3d 100644 --- a/test/spec/jquery.spec.js +++ b/test/spec/jquery.spec.js @@ -1,34 +1,32 @@ -/* Copyright (c) 2013 IndexData ApS. http://indexdata.com +/* Copyright (c) 2013-2015 Index Data ApS. http://indexdata.com * - * jQuery test + * jquery test * */ -var $ = jQuery = require('jquery'); +describe("jquery suite simple", function () { + var $ = require('jquery')(require("jsdom").jsdom().parentWindow); -describe("jQuery suite", function() { - it("jQuery append test", function() { - jQuery("

test passes h1

").appendTo("body"); - expect( $("body").html() ).toMatch(/

/); + it("jquery append test", function () { + $("body").append("

test passes h1

"); + expect($("body").html()).toMatch(/

/); + $("

this is a paragraph

").appendTo("h1"); + expect($("body").html()).toMatch(/this is a paragraph/); + }); - jQuery("

this is a paragraph

").appendTo("h1"); - expect( $("body").html() ).toMatch(/this is a paragraph/); - }); + it("$ append test", function () { + $("

test passes h2

").appendTo("body"); + expect($("body").html()).toMatch(/

/); - it("$ append test", function() { - $("

test passes h2

").appendTo("body"); - expect( $("body").html() ).toMatch(/

/); + $("

this is a second paragraph

").appendTo("h1"); + expect($("body").html()).toMatch(/this is a paragraph/); + }); - $("

this is a second paragraph

").appendTo("h1"); - expect( $("body").html() ).toMatch(/this is a paragraph/); - }); - - it("more jquery tests", function() { - // other tests - expect( $("h2").html() ).toMatch(/test passes h2/); - expect( $("h1").html() ).toMatch(/test passes h1/); - expect( $("h1").html() ).not.toMatch(/^$/); - expect( $("h1").html() ).not.toMatch(/foobar/); - }); + it("more jquery tests", function () { + // other tests + expect($("h2").html()).toMatch(/test passes h2/); + expect($("h1").html()).toMatch(/test passes h1/); + expect($("h1").html()).not.toMatch(/^$/); + expect($("h1").html()).not.toMatch(/foobar/); + }); }); -