An open API service indexing awesome lists of open source software.

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

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();