https://github.com/phstc/ajsunit
Yes, it's an Another JavaScript Unit Test library
https://github.com/phstc/ajsunit
Last synced: over 1 year ago
JSON representation
Yes, it's an Another JavaScript Unit Test library
- Host: GitHub
- URL: https://github.com/phstc/ajsunit
- Owner: phstc
- Created: 2010-10-30T18:43:40.000Z (over 15 years ago)
- Default Branch: master
- Last Pushed: 2012-09-06T03:06:11.000Z (almost 14 years ago)
- Last Synced: 2025-01-27T08:45:24.908Z (over 1 year ago)
- Language: JavaScript
- Homepage: http://pablocantero.com/
- Size: 102 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rdoc
Awesome Lists containing this project
README
= Yes, it's an Another JavaScript Unit Test library
== Why?
* Simple && Small && Fast as possible.
* No external dependecies (JavasScript, HTML or CSS files) needed.
== Assertions
* ok(condition, message)
* ne(expected, actual, message)
* eq(expected, actual, message)
The *message* parameter is optional for all assertions.
== Example
var testSuite = {
tests: {
"test an error condition": function(){
// throws "ReferenceError" "asdasadasdasda is not defined"
asdasadasdasda
},
"test a false, true, false and error condition": function(t){
t.ok("a" === "b");
t.ok("a" !== "b");
t.ok("a" === "c");
},
"test a true condition": function(t){
t.ok("a" === "a");
},
"test a false comparison": function(t){
t.ne("a", "b");
},
"test a true comparison": function(t){
t.eq("a", "a");
}
}
};
new AJSUnit(testSuite).executeOnLoad();