vitest-marbles
Version:
Marble testing helpers library for RxJs and Jest
22 lines • 862 B
JavaScript
import '../vitest/custom-matchers';
function expectedIsSubscriptionLogArray(actual, expected) {
return ((actual.length === 0 && expected.length === 0) ||
(expected.length !== 0 && expected[0].subscribedFrame !== undefined));
}
function actualIsSubscriptionsAndExpectedIsEmpty(actual, expected) {
return expected.length === 0 && actual.length !== 0 && actual[0].subscribedFrame !== undefined;
}
export function assertDeepEqual(actual, expected) {
if (!expected)
return;
if (actualIsSubscriptionsAndExpectedIsEmpty(actual, expected)) {
expect(actual).toHaveEmptySubscriptions();
}
else if (expectedIsSubscriptionLogArray(actual, expected)) {
expect(actual).toBeSubscriptions(expected);
}
else {
expect(actual).toBeNotifications(expected);
}
}
//# sourceMappingURL=assert-deep-equal.js.map