Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import { marbles } from 'rxjs-marbles';
/* eslint-env mocha */
/* eslint-disable no-unused-expressions */
describe('merge scan', () => {
it(
'should work',
marbles(
(m) => {
m.expect(
m.cold('1234')
.mergeScan(
(acc, val) => m.cold(
'1-2|',
{
1: `${acc}${val}`,
2: `${acc}${val}!`,
}),
'+',
1,
),
).toBeObservable(
'1-23-45-67-8',
{
1: '+1',
2: '+1!',
3: '+1!2',
4: '+1!2!',
5: '+1!2!3',
6: '+1!2!3!',
7: '+1!2!3!4',
8: '+1!2!3!4!',
},
);
},
),
);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.