@ic-wallet-kit/hpl
Version:
Ic middleware wallet HPL protocol
23 lines (22 loc) • 572 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.itForeach = void 0;
function itForeach(tests, fn) {
it.each(tests)("$name", async (test) => {
try {
await fn(test);
if (test.error) {
throw new Error("Test doesn't throw error as expected");
}
}
catch (e) {
if (test.error) {
expect(e).toEqual(test.error);
}
else {
throw e;
}
}
});
}
exports.itForeach = itForeach;