Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { toEqual } from 'jest-matchers/build/matchers';
import { SubscriptionLog } from 'rxjs/internal/testing/SubscriptionLog';
import { TestMessage } from '../message/TestMessage';
import { constructObservableMarble } from './constructObservableMarble';
import { constructSubscriptionMarble } from './constructSubscriptionMarble';
const { matcherHint, printExpected, printReceived } = require('jest-matcher-utils'); //tslint:disable-line:no-require-imports no-var-requires
const toEqualAssert = toEqual.bind({ expand: false });
const subscriptionMarbleAssert = (source: Array) => (expected: Array) => {
const asserted = toEqualAssert(source, expected);
if (!asserted.pass) {
const length = source.length > expected.length ? source.length : expected.length;
let description = `
${matcherHint(' to equal ')}
`;
for (let idx = 0; idx < length; idx++) {
const sourceMarble = !!source[idx]
? constructSubscriptionMarble(source[idx])
: { marbleString: '', frameString: '' };
const expectedMarble = !!expected[idx]
? constructSubscriptionMarble(expected[idx])