Merge branch 'master' of ssh://git.indexdata.com:222/home/git/pub/mkws
authorWolfram Schneider <wosch@indexdata.dk>
Wed, 7 Jan 2015 12:19:32 +0000 (12:19 +0000)
committerWolfram Schneider <wosch@indexdata.dk>
Wed, 7 Jan 2015 12:19:32 +0000 (12:19 +0000)
test/package.json
test/spec/jquery.spec.js
test/spec/jsdom.spec.js [deleted file]

index 5c29d2d..98f19a9 100644 (file)
@@ -10,9 +10,9 @@
         "email": "wosch@indexdata.com"
     }],
     "devDependencies": {
-        "jQuery": "*",
+        "jquery": "*",
+        "jsdom": "*",
         "xmlhttprequest": "*",
-        "jsdom": "<= 0.11.1",
         "cssstyle": "<= 0.2.14",
         "request": "*",
         "jasmine-reporters": "<= 0.4.1",
index 152f719..2617b3d 100644 (file)
@@ -1,13 +1,13 @@
-/* Copyright (c) 2013 Index Data ApS. http://indexdata.com
+/* Copyright (c) 2013-2015 Index Data ApS. http://indexdata.com
  *
- * jQuery test
+ * jquery test
  *
  */
 
-describe("jQuery suite simple", function () {
-    var $ = require('jQuery');
+describe("jquery suite simple", function () {
+    var $ = require('jquery')(require("jsdom").jsdom().parentWindow);
 
-    it("jQuery append test", function () {
+    it("jquery append test", function () {
         $("body").append("<h1>test passes h1</h1>");
         expect($("body").html()).toMatch(/<h1>/);
         $("<p>this is a paragraph</p>").appendTo("h1");
diff --git a/test/spec/jsdom.spec.js b/test/spec/jsdom.spec.js
deleted file mode 100644 (file)
index 273f591..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Copyright (c) 2013 Index Data ApS. http://indexdata.com
- *
- * jQuery test with DOM/windows object
- *
- */
-
-describe("jQuery suite", function () {
-    var jsdom = require('jsdom').jsdom;
-    var myWindow = jsdom().createWindow();
-
-    var $ = require('jQuery');
-    var jq = require('jQuery').create();
-    var jQuery = require('jQuery').create(myWindow);
-
-    it("jQuery append test", function () {
-        jQuery("<h1>test passes h1</h1>").appendTo("body");
-        expect(jQuery("body").html()).toMatch(/<h1>/);
-    });
-
-    it("$ append test", function () {
-        $("<h2>test passes h2</h2>").appendTo("body");
-        expect($("body").html()).toMatch(/<h2>/);
-    });
-
-    it("jq append test", function () {
-        jq("<h2>test passes h2</h2>").appendTo("body");
-        expect(jq("body").html()).toMatch(/<h2>/);
-    });
-
-    it("window test", function () {
-        expect(myWindow).toBeDefined();
-    });
-});