The company name is: Index Data
[mkws-moved-to-github.git] / test / spec / jquery.spec.js
index 8b93117..152f719 100644 (file)
@@ -1,33 +1,32 @@
-/*
- * jQuery test for node.js
+/* Copyright (c) 2013 Index Data ApS. http://indexdata.com
+ *
+ * jQuery test
  *
  */
 
-var $ = jQuery = require('jquery');
-
-describe("jQuery suite", function() {
-  it("jQuery append test", function() {
-    jQuery("<h1>test passes h1</h1>").appendTo("body");
-    expect( $("body").html() ).toMatch(/<h1>/);
+describe("jQuery suite simple", function () {
+    var $ = require('jQuery');
 
-    jQuery("<p>this is a paragraph</p>").appendTo("h1");
-    expect( $("body").html() ).toMatch(/this is a paragraph/);
-  });
+    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");
+        expect($("body").html()).toMatch(/this is a paragraph/);
+    });
 
-  it("$ append test", function() {
-    $("<h2>test passes h2</h2>").appendTo("body");
-    expect( $("body").html() ).toMatch(/<h2>/);
+    it("$ append test", function () {
+        $("<h2>test passes h2</h2>").appendTo("body");
+        expect($("body").html()).toMatch(/<h2>/);
 
-    $("<p>this is a second paragraph</p>").appendTo("h1");
-    expect( $("body").html() ).toMatch(/this is a paragraph/);
-  });
+        $("<p>this is a second paragraph</p>").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/);
-  });
+    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/);
+    });
 });
-