beast-test
v0.0.14
Published
A package that allow for JUnit like TestCases. Very Robust Test Driven Development Framework
Downloads
20
Maintainers
Readme
Beast Javascript TestSuite
create by Shavauhn Gabay
This framework was create to bring a more elegant syntax to Unit Testing in CoffeeScript / Javascript. The aim was to get the code as readible as possible but still allow users to create testcase rapidly and test their application.
####Examples
Inorder to create a new Test class just extend the TestCase class
#coffeescript
MyTest extends TestCase
constructor:->
super() #the super must be called
#base object that is passed to every test method
base:->
{
fname:"Shavauhn"
lname:"Gabay"
}
If you want to pass multiple items then you can pass them in an array
#coffeescript
MyTest extends TestCase
constructor:->
super() #the super must be called
#This will pass two items to the test methods
base:->
someItem="hello"
obj = {
fname:"Shavauhn"
lname:"Gabay"
}
return [someItem,obj]
To defined a test method it is rather easy just name it test_____________ and fill it with what ever name you want.
#coffeescript
MyTest extends TestCase
constructor:->
super() #the super must be called
#base object that is passed to every test method
base:->
someItem="hello"
obj = {
fname:"Shavauhn"
lname:"Gabay"
}
return [someItem,obj]
testGiveMeBase:(someItem,obj)
@assertEquals(someItem,"hello") #true
from here on out you can check the API and the Youtube video for more instructions