-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: series with duplicated values (#2841)
- Loading branch information
1 parent
32e8b1d
commit 1f06765
Showing
2 changed files
with
32 additions
and
5 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { createEvent, createWatch } from 'effector'; | ||
|
||
import { series } from './series'; | ||
|
||
describe('series', () => { | ||
it('should spread array into events', () => { | ||
const spy = jest.fn(); | ||
const targetEvent = createEvent<number>(); | ||
const wrappedEvent = series(targetEvent); | ||
|
||
createWatch({ | ||
unit: targetEvent, | ||
fn: spy, | ||
}); | ||
|
||
wrappedEvent([1, 2, 2, 3, 3, 3]); | ||
|
||
expect(spy).toHaveBeenCalledTimes(6); | ||
expect(spy.mock.calls).toEqual([[1], [2], [2], [3], [3], [3]]); | ||
}); | ||
}); |
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