basic tests with jasmine
authorWolfram Schneider <wosch@indexdata.dk>
Tue, 20 Aug 2013 14:43:55 +0000 (16:43 +0200)
committerWolfram Schneider <wosch@indexdata.dk>
Tue, 20 Aug 2013 14:43:55 +0000 (16:43 +0200)
test/README.txt [new file with mode: 0644]
test/spec/SampleSpecs.js [new file with mode: 0644]
test/spec/mkws-true.js [new file with mode: 0644]

diff --git a/test/README.txt b/test/README.txt
new file mode 100644 (file)
index 0000000..5ed0c41
--- /dev/null
@@ -0,0 +1,11 @@
+Jasmine / jasmine-node test frame works
+-------------------------------------
+
+./spec         contains *spec.js files
+README.txt     this file
+
+Documentation
+-------------------------------------
+http://pivotal.github.io/jasmine/
+https://github.com/pivotal/jasmine
+
diff --git a/test/spec/SampleSpecs.js b/test/spec/SampleSpecs.js
new file mode 100644 (file)
index 0000000..f9c001b
--- /dev/null
@@ -0,0 +1,25 @@
+describe('jasmine-node', function(){
+
+  it('should pass', function(){
+    expect(1+2).toEqual(3);
+  });
+
+  it('shows asynchronous test', function(){
+    setTimeout(function(){
+      expect('second').toEqual('second');
+      asyncSpecDone();
+    }, 1);
+    expect('first').toEqual('first');
+    asyncSpecWait();
+  });
+
+  it('shows asynchronous test node-style', function(done){
+    setTimeout(function(){
+      expect('second').toEqual('second');
+      // If you call done() with an argument, it will fail the spec 
+      // so you can use it as a handler for many async node calls
+      done();
+    }, 1);
+    expect('first').toEqual('first');
+  });
+});
diff --git a/test/spec/mkws-true.js b/test/spec/mkws-true.js
new file mode 100644 (file)
index 0000000..3078052
--- /dev/null
@@ -0,0 +1,9 @@
+
+describe("A suite", function() {
+  it("contains spec with an expectation", function() {
+    expect(true).toBe(true);
+  });
+
+  // alert("foobar");
+});
+