From: Wolfram Schneider Date: Wed, 21 Aug 2013 12:41:25 +0000 (+0200) Subject: a basic jquery test for jasmine X-Git-Tag: 0.9.1~202^2~108 X-Git-Url: http://git.indexdata.com/?a=commitdiff_plain;h=7f16806f51445cf3d5759a31e5752694cd9708c8;p=mkws-moved-to-github.git a basic jquery test for jasmine --- diff --git a/test/spec/jquery.spec.js b/test/spec/jquery.spec.js new file mode 100644 index 0000000..1a59cf2 --- /dev/null +++ b/test/spec/jquery.spec.js @@ -0,0 +1,28 @@ +var $ = jQuery = require('jquery'); + +describe("jQuery suite", function() { + it("jQuery append test", function() { + jQuery("

test passes h1

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

/); + + 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(/

/); + + $("

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/); + }); +}); +