Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('fails when the value does not have a concat method', async () => {
let promise;
try {
promise = createPromiseFromStreams([
createListStream([1, '1']),
createConcatStream()
]);
} catch (err) {
expect.fail('createPromiseFromStreams() should not fail synchronously');
}
try {
await promise;
expect.fail('Promise should have rejected');
} catch (err) {
expect(err).to.be.an(Error);
expect(err.message).to.contain('concat');
}
});
});
it('fails when the value does not have a concat method', async () => {
let promise;
try {
promise = createPromiseFromStreams([
createListStream([1, '1']),
createConcatStream()
]);
} catch (err) {
expect.fail('createPromiseFromStreams() should not fail synchronously');
}
try {
await promise;
expect.fail('Promise should have rejected');
} catch (err) {
expect(err).to.be.an(Error);
expect(err.message).to.contain('concat');
}
});
});
spy.thisValues.forEach(function ($this) {
if ($this.is(els.$scroller) || $this.is(els.$container)) return;
expect.fail('expected ' + name + ' to be called with $scroller or $container');
});
}