Skip to content

Commit

Permalink
chore(tests): add tests for skip
Browse files Browse the repository at this point in the history
  • Loading branch information
benlesh committed Aug 19, 2015
1 parent ef2620e commit 314c93f
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions spec/operators/skip-spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/* globals describe, it, expect */
var Rx = require('../../dist/cjs/Rx');
var Observable = Rx.Observable;

describe('Observable.prototype.skip()', function () {
it('should skip values before a total', function (done) {
var expected = [4, 5];
Observable.of(1, 2, 3, 4, 5).skip(3).subscribe(function (x) {
expect(x).toBe(expected.shift());
}, null, done);
});

it('should skip all values without error if total is more than actual number of values', function (done) {
Observable.of(1, 2, 3, 4, 5).skip(6).subscribe(function (x) {
expect(true).toBe('this should never be called');
}, null, done);
});
});

0 comments on commit 314c93f

Please sign in to comment.