@getclave/lifi-sdk
Version:
LI.FI Any-to-Any Cross-Chain-Swap SDK
16 lines (15 loc) • 766 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const vitest_1 = require("vitest");
const baseError_1 = require("./baseError");
const constants_1 = require("./constants");
(0, vitest_1.describe)('baseError', () => {
(0, vitest_1.it)('should set the stack to the same as the deep rooted cause', () => {
const rootError = new Error();
rootError.stack = 'root stack trace';
const intermediateError = new Error();
intermediateError.cause = rootError;
const errorChain = new baseError_1.BaseError(constants_1.ErrorName.UnknownError, constants_1.LiFiErrorCode.InternalError, 'There was an error', intermediateError);
(0, vitest_1.expect)(errorChain.stack).toBe(rootError.stack);
});
});