Improve errors with the domaine and how to use the API
This commit is contained in:
14
src/core/formatErrorMsg.js
Normal file
14
src/core/formatErrorMsg.js
Normal file
@@ -0,0 +1,14 @@
|
||||
getJasmineRequireObj().formatErrorMsg = function() {
|
||||
|
||||
function generateErrorMsg(domain, usage, reco) {
|
||||
|
||||
var usageDefinition = usage ? 'Usage: ' + usage + '\n' : '';
|
||||
var recoDefinition = reco ? 'Tips: ' + reco + '\n' : '';
|
||||
|
||||
return function errorMsg(msg) {
|
||||
return domain + ' : ' + msg + '\n' + usageDefinition + recoDefinition;
|
||||
};
|
||||
}
|
||||
|
||||
return generateErrorMsg;
|
||||
};
|
||||
Reference in New Issue
Block a user