hive-js-dev
Version:
Steem.js the JavaScript API for Steem blockchain
19 lines (17 loc) • 459 B
JavaScript
var assert = require('assert');
module.exports = {
error(message_substring, f){
var fail = false;
try {
f();
fail = true;
} catch (e) {
if (e.toString().indexOf(message_substring) === -1) {
throw new Error("expecting " + message_substring);
}
}
if (fail) {
throw new Error("expecting " + message_substring);
}
}
}