Last active
August 29, 2015 14:04
-
-
Save color2life/b2ca861bcd3e8128ae80 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var TestSuite = { | |
module: function(name, testCases) { | |
this.result('<b><br/>Module: ' + name + ' testing</b>'); | |
testCases(TestSuite); | |
}, | |
test: function(name, testCase) { | |
this.result('Test: ' + name); | |
testCase(TestSuite.assert); | |
}, | |
before: function(hook) { | |
this.result('before Run'); | |
hook(); | |
}, | |
assert: { | |
equals: function(a, b, c) { | |
c = c || ''; | |
if (a === b) { | |
return TestSuite.result('Equal '+ c); | |
} | |
}, | |
notEquals: function(a, b, c) { | |
c = c || ''; | |
if (a !== b) { | |
return TestSuite.result('Not equal '+ c); | |
} | |
} | |
}, | |
result: function (results) { | |
var doc = document; | |
var resultDiv = doc.getElementById('results'); | |
var testResults = doc.createElement('div'); | |
testResults.innerHTML = results; | |
resultDiv.appendChild(testResults); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment