2 * jQuery test for node.js
6 var $ = jQuery = require('jquery');
8 describe("jQuery suite", function() {
9 it("jQuery append test", function() {
10 jQuery("<h1>test passes h1</h1>").appendTo("body");
11 expect( $("body").html() ).toMatch(/<h1>/);
13 jQuery("<p>this is a paragraph</p>").appendTo("h1");
14 expect( $("body").html() ).toMatch(/this is a paragraph/);
17 it("$ append test", function() {
18 $("<h2>test passes h2</h2>").appendTo("body");
19 expect( $("body").html() ).toMatch(/<h2>/);
21 $("<p>this is a second paragraph</p>").appendTo("h1");
22 expect( $("body").html() ).toMatch(/this is a paragraph/);
25 it("more jquery tests", function() {
27 expect( $("h2").html() ).toMatch(/test passes h2/);
28 expect( $("h1").html() ).toMatch(/test passes h1/);
29 expect( $("h1").html() ).not.toMatch(/^$/);
30 expect( $("h1").html() ).not.toMatch(/foobar/);