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