1 /* Copyright (c) 2013 IndexData ApS. http://indexdata.com
3 * jQuery test with DOM/windows object
7 var jsdom = require('jsdom').jsdom;
8 var myWindow = jsdom().createWindow();
9 var $ = require('jquery');
10 var jq = require('jquery').create();
11 var jQuery = require('jquery').create(myWindow);
13 describe("jQuery suite", function() {
14 it("jQuery append test", function() {
15 jQuery("<h1>test passes h1</h1>").appendTo("body");
16 expect( jQuery("body").html() ).toMatch(/<h1>/);
19 it("$ append test", function() {
20 $("<h2>test passes h2</h2>").appendTo("body");
21 expect( $("body").html() ).toMatch(/<h2>/);
24 it("jq append test", function() {
25 jq("<h2>test passes h2</h2>").appendTo("body");
26 expect( jq("body").html() ).toMatch(/<h2>/);
31 describe("jsdom suite", function() {
32 it("window test", function() {
33 expect(myWindow).toBeDefined();