2008MAY261447
Wanted: testing that sucks less
A quick way to write tests for javascript, using existing testing frameworks and if possible get data back instead of being tied to a gui.
Well I've got the first bit done. Using my
- js code I want tested
- test code
- a simple page calling css, dependencies and source files
The key bit is the YUI Test lib. Not only does it work, there are plenty of examples that show you how it works. But this isn't enough. I want to be able to
- create a series of tests
- write the code against the tests
- call a url that gets back the test results only
From there I can do a lot of things. Add the data to a database, write reports, show bugs over time etc. The key bit is I'm not tied to a gui.
What you see here is a simple test to see if what I put in a simple object is correct. Nothing more. The key bit also is the code, the test, the page that calls it and most important the data that is generated is independent of each other.
I just wanted to test if a failure works as well. Using "YAHOO.util.Assert.fail();". Still todo is the Test Reporting generating the results in JSON format.
<<< start
2008MAY261447
Wanted: testing that sucks less
A quick way to write tests for javascript, using existing testing frameworks and if possible get data back instead of being tied to a gui.
Well I've got the first bit done. Using my
- js code I want tested
- test code
- a simple page calling css, dependencies and source files
The key bit is the YUI Test lib. Not only does it work, there are plenty of examples that show you how it works. But this isn't enough. I want to be able to
- create a series of tests
- write the code against the tests
- call a url that gets back the test results only
From there I can do a lot of things. Add the data to a database, write reports, show bugs over time etc. The key bit is I'm not tied to a gui.
What you see here is a simple test to see if what I put in a simple object is correct. Nothing more. The key bit also is the code, the test, the page that calls it and most important the data that is generated is independent of each other.
I just wanted to test if a failure works as well. Using "YAHOO.util.Assert.fail();". Still todo is the Test Reporting generating the results in JSON format.
<<< start