Last active
January 3, 2018 17:36
-
-
Save gilesbradshaw/ab6d75f75cf9d90ce9e7a25a8112831d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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