From 10b613c97dbfdc377ad7476ad836c089f572a8de Mon Sep 17 00:00:00 2001 From: pivotal Date: Tue, 2 Dec 2008 19:59:13 -0800 Subject: [PATCH] dwf: small cleanups. --- README | 20 ++++++++++++++ README.markdown | 70 +++++++++++++++++++++++++++++++++++++++++++++++++ jasmine.iws | 6 ++--- lib/jasmine.js | 2 -- 4 files changed, 93 insertions(+), 5 deletions(-) create mode 100644 README create mode 100644 README.markdown diff --git a/README b/README new file mode 100644 index 0000000..f81ab5b --- /dev/null +++ b/README @@ -0,0 +1,20 @@ +Jasmine +======= +**yet another JavaScript testing framework** + +The Problem +----------- + +There are some situations when you want to test-drive JavaScript, but you don't want to be bothered with or even have an explicit document. You have no DOM to work with and so don't have HTML elements on which to hang events handlers. You may need to make asynchronous calls (say, to an AJAX API) and cannot mock/stub them. + +But you still need to write tests. + +What's an Agile Engineer to do? + +The Solution +------------ + +Enter Jasmine. + +Jasmine is yet another JavaScript testing framework. It's *heavily* influenced by [RSpec]() & [JSpec](http://github.com/visionmedia/jspec/tree/master), + diff --git a/README.markdown b/README.markdown new file mode 100644 index 0000000..b5ecaa3 --- /dev/null +++ b/README.markdown @@ -0,0 +1,70 @@ +Jasmine +======= +**yet another JavaScript testing framework** + +Why another frickin' JS tdd/bdd framework? +----------- + +There are some situations when you want to test-drive JavaScript, but you don't want to be bothered with or even have an explicit document. You have no DOM to work with and so don't have HTML elements on which to hang events handlers. You may need to make asynchronous calls (say, to an AJAX API) and cannot mock/stub them. + +But you still need to write tests. + +What's an Agile Engineer to do? + +Enter Jasmine +------------ + +Jasmine is yet another JavaScript testing framework. It's *heavily* influenced by JSSpec, ScrewUnit & [JSpec](http://github.com/visionmedia/jspec/tree/master), which are all influenced by RSpec. But each of those was lacking in some way: JSSpec & ScrewUnit required a DOM. JSpec's DOM-less assumption was a great start, but it needed asynchronous support. + +So we started over. And TDD'd a whole new framework. Enjoy. + +How To +------ + +### Runner + +Jasmine() + +You don't need a DOM, but you do need a page on which to load & execute your JS. + +### Suites + +Group your specs via describe + +### Specs + +call it() and provide a desc & a function + +call runs + +alias of runs to then + +#### Asynchronous support + +call waits + +### Custom Matchers + +use Matchers.method('name', function ()). Write TESTS! + +### Reports + +no reporting yet other than Runner.results, which is walkable + +### Tests + +There is a VERY simple test reporter - it's not even a framework at all - that allows you to write tests. + +Contributing +----------- + +Contributions are welcome. Please submit tests with your pull request. + +### TODO +* protect the global-ness of some variables & functions +* suite.beforeAll and suite.afterAll +* JSON reporter +* HTML reporter (callback driven) + + + diff --git a/jasmine.iws b/jasmine.iws index 0a0882e..d931cac 100644 --- a/jasmine.iws +++ b/jasmine.iws @@ -110,7 +110,7 @@ - + @@ -305,7 +305,7 @@ - + @@ -458,7 +458,7 @@ - + diff --git a/lib/jasmine.js b/lib/jasmine.js index 4db05ad..5e26b1c 100755 --- a/lib/jasmine.js +++ b/lib/jasmine.js @@ -294,7 +294,5 @@ var currentSpec; * - Failed output is styled with red * - JSON reporter * - Lists full results as a JSON object/string - * - Luna reporter - * - each result calls back into widgets for rendering to Luna views */