From 189c2d34ac3c77d5aaf90d421db0c1c2b54fff46 Mon Sep 17 00:00:00 2001 From: Wolfram Schneider Date: Tue, 20 Aug 2013 16:43:55 +0200 Subject: [PATCH] basic tests with jasmine --- test/README.txt | 11 +++++++++++ test/spec/SampleSpecs.js | 25 +++++++++++++++++++++++++ test/spec/mkws-true.js | 9 +++++++++ 3 files changed, 45 insertions(+) create mode 100644 test/README.txt create mode 100644 test/spec/SampleSpecs.js create mode 100644 test/spec/mkws-true.js 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"); +}); + -- 1.7.10.4