Skip to content

Commit

Permalink
test(mergeScan): update spec, remove unnecessary dtest
Browse files Browse the repository at this point in the history
  • Loading branch information
martinsik committed Jan 9, 2019
1 parent f27b098 commit dfd6213
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
4 changes: 0 additions & 4 deletions spec-dtslint/operators/mergeScan-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ it('should support a currency', () => {
const o = of(1, 2, 3).pipe(mergeScan((acc, value) => of(acc + value), '', 47)); // $ExpectType Observable<string>
});

it('should support an index parameter', () => {
const o = of(1, 2, 3).pipe(mergeScan((acc, value, index) => of(index), 0)); // $ExpectType Observable<number>
});

it('should enforce types', () => {
const o = of(1, 2, 3).pipe(mergeScan()); // $ExpectError
});
Expand Down
8 changes: 3 additions & 5 deletions spec/operators/mergeScan-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { expect } from 'chai';

declare const rxTestScheduler: TestScheduler;
/** @test {mergeScan} */
describe.only('mergeScan', () => {
describe('mergeScan', () => {
it('should mergeScan things', () => {
const e1 = hot('--a--^--b--c--d--e--f--g--|');
const e1subs = '^ !';
Expand Down Expand Up @@ -422,15 +422,13 @@ describe.only('mergeScan', () => {

it('should pass current index to accumulator', () => {
const recorded: number[] = [];
const expected = [0, 1, 2, 3];
const e1 = hot('--a--b--c--d-|');
const e1 = of('a', 'b', 'c', 'd');

e1.pipe(mergeScan((acc, x, index) => {
recorded.push(index);
return of(x);
}, 0)).subscribe();

rxTestScheduler.flush();
expect(recorded).to.deep.equal(expected);
expect(recorded).to.deep.equal([0, 1, 2, 3]);
});
});

0 comments on commit dfd6213

Please sign in to comment.