@hn3000/json-ref
Version:
simple resolver for json reference and json pointer
37 lines • 1.61 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.runTests = void 0;
var json_ptr_test_1 = require("./json-ptr.test");
var json_ref_test_1 = require("./json-ref.test");
var tsunit_async_1 = require("@hn3000/tsunit-async");
function parmNum(t) {
return (null != t.parameterSetNumber) ? "[".concat(t.parameterSetNumber, "]") : '';
}
function runTests() {
"use strict";
var test = new tsunit_async_1.TestAsync();
test.addTestClass(new json_ptr_test_1.JsonPointerTest(), "JsonPointerTest");
test.addTestClass(new json_ref_test_1.JsonReferenceTest(), "JsonReferenceTest");
var promise = test.runAsync();
promise.then(function (result) {
//console.log(result);
if (result.errors.length) {
console.log('---');
result.errors.forEach(function (e) {
console.log("Failed: ".concat(e.testName, ".").concat(e.funcName).concat(parmNum(e), " - ").concat(e.message));
});
console.log('---');
console.log("ran unit tests, ".concat(result.passes.length, " passed, ").concat(result.errors.length, " failed"));
}
else {
var testnames = result.passes.map(function (x) { return "".concat(x.testName, ".").concat(x.funcName).concat(parmNum(x)); }).join('\n');
console.log('---');
console.log(testnames);
console.log('---');
console.log("ran unit tests, all ".concat(result.passes.length, " tests passed"));
}
});
}
exports.runTests = runTests;
runTests();
//# sourceMappingURL=allTests.js.map