mirror of
https://bitbucket.org/bellord13/kit.git
synced 2026-11-13 19:06:11 +03:00
33 lines
790 B
JavaScript
33 lines
790 B
JavaScript
/** @module testing */
|
|
__PluginManager__.register('testing', function(module, exports, require, global){
|
|
|
|
/**
|
|
* @constructor
|
|
*/
|
|
function Unit() {
|
|
this.logger = new kit.Logger();
|
|
}
|
|
|
|
Unit.prototype.assertSame = function (expected, actual, message) {
|
|
if(expected === actual) {
|
|
this.logger.success({pass: message});
|
|
return true;
|
|
}
|
|
if(expected == actual) {
|
|
this.logger.warning({warn: message}, {expected: expected, actual: actual});
|
|
return false;
|
|
}
|
|
this.logger.error({fail: message}, {expected: expected, actual: actual});
|
|
return false;
|
|
};
|
|
|
|
/**
|
|
* @memberOf kit
|
|
*/
|
|
var testing = {
|
|
Unit,
|
|
};
|
|
|
|
return module.exports = testing;
|
|
});
|