Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('should have a channel defined', () => {
expect(parseMessageEnvelopeElseNull({message: {}})).toBeNull();
expect(parseMessageEnvelopeElseNull({protocol: PROTOCOL, channel: null, message: {}})).toBeNull();
});
});
it('must not be null or undefined', () => {
expect(parseMessageEnvelopeElseNull(null)).toBeNull();
expect(parseMessageEnvelopeElseNull(undefined)).toBeNull();
});
it('must not be null or undefined', () => {
expect(parseMessageEnvelopeElseNull(null)).toBeNull();
expect(parseMessageEnvelopeElseNull(undefined)).toBeNull();
});
it('must be an object', () => {
expect(parseMessageEnvelopeElseNull('')).toBeNull();
expect(parseMessageEnvelopeElseNull(true)).toBeNull();
expect(parseMessageEnvelopeElseNull(42)).toBeNull();
expect(parseMessageEnvelopeElseNull(() => {
})).toBeNull();
});
it('must be an object', () => {
expect(parseMessageEnvelopeElseNull('')).toBeNull();
expect(parseMessageEnvelopeElseNull(true)).toBeNull();
expect(parseMessageEnvelopeElseNull(42)).toBeNull();
expect(parseMessageEnvelopeElseNull(() => {
})).toBeNull();
});
it('must be an object', () => {
expect(parseMessageEnvelopeElseNull('')).toBeNull();
expect(parseMessageEnvelopeElseNull(true)).toBeNull();
expect(parseMessageEnvelopeElseNull(42)).toBeNull();
expect(parseMessageEnvelopeElseNull(() => {
})).toBeNull();
});
.subscribe((data: any) => {
const envelope = parseMessageEnvelopeElseNull(data);
if (!envelope) {
return;
}
this._zone.run(() => this.dispatchMessageFromSite(envelope));
});
}