From: Wolfram Schneider Date: Tue, 20 Aug 2013 14:43:55 +0000 (+0200) Subject: basic tests with jasmine X-Git-Tag: 0.9.1~202^2~126 X-Git-Url: http://sru.miketaylor.org.uk/?a=commitdiff_plain;h=189c2d34ac3c77d5aaf90d421db0c1c2b54fff46;p=mkws-moved-to-github.git basic tests with jasmine --- diff --git a/test/README.txt b/test/README.txt new file mode 100644 index 0000000..5ed0c41 --- /dev/null +++ b/test/README.txt @@ -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 index 0000000..f9c001b --- /dev/null +++ b/test/spec/SampleSpecs.js @@ -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 index 0000000..3078052 --- /dev/null +++ b/test/spec/mkws-true.js @@ -0,0 +1,9 @@ + +describe("A suite", function() { + it("contains spec with an expectation", function() { + expect(true).toBe(true); + }); + + // alert("foobar"); +}); +