Example #1
0
			.then(function() {
				expect(n).toBe(0);
			});
Example #2
0
	}, values, evented, stream).then(function (count) {
		expect(count).toBe(1);
	}).then(function() {
Example #3
0
			return observe(function (array) {
				expect(array).toEqual(values[1]);
			}, s);
Example #4
0
			['catch'](function(e) {
				expect(e).toBe(sentinel);
			});
Example #5
0
	}, values, evented, stream).then(function(count) {
		expect(count).toBe(values.length-1);
	});
Example #6
0
		}, s).then(function() {
			expect(count).toBe(expected);
		});
Example #7
0
		return drain(s).then(function() {
			expect(dispose).toHaveBeenCalledTwice();
		});
Example #8
0
	it('should return function with a reasonable name', function() {
		function aTestFunction() {}
		expect(lift(aTestFunction).name.indexOf(aTestFunction.name)).toBeGreaterThan(-1);
	});
Example #9
0
		return observe(function(x) {
			expect(x).toBe(f('a', 'b', 'c'));
		}, take(3, lifted(a, b, c)));
Example #10
0
		}, 0).then(function(count) {
			expect(count).toBe(1);
		});
Example #11
0
	it('should return function with same arity', function() {
		expect(lift(function() {}).length).toBe(0);
		expect(lift(function(x) {}).length).toBe(1);
		expect(lift(function(x, y) {}).length).toBe(2);
		expect(lift(function(x, y, z) {}).length).toBe(3);
	});
Example #12
0
		return s.reduce(function(count, x) {
			expect(x).toBe(sentinel);
			return count + 1;
		}, 0).then(function(count) {
Example #13
0
		}, [], monoid.concat(s1, s2)).then(function(a) {
			expect(a).toEqual([3,4,1,2]);
		});
Example #14
0
		}).then(function() {
			expect(true).toBeTrue();
		});
Example #15
0
			observe(function(y) {
				expect(x).toBe(y);
				resolve();
			}, p2).catch(reject);
Example #16
0
		return observe(function(x) {
			expect(x).toBe(sentinel);
			expect(iterator).not.toHaveBeenCalled();
		}, s);
Example #17
0
		return observe(function(x) {
			expect(x).toBe(count);
			count++;
		}, s).then(function() {
Example #18
0
		}, s).then(function() {
			expect(iterator).toHaveBeenCalledOnceWith(0);
		});
Example #19
0
		return observe(spy, s).catch(function(e) {
			expect(spy).not.toHaveBeenCalled();
			expect(e).toBe(sentinel);
		});
Example #20
0
		return observe(spy, s).catch(function(e) {
			expect(spy).toHaveBeenCalledOnceWith(other);
			expect(e).toBe(sentinel);
		});
Example #21
0
		return observe(function(x) {
			expect(x).toBe(sentinel);
		}, s);
Example #22
0
			}, [], s).then(function(result) {
				expect(result).toEqual([1, 2, 3, 1, 2, 3, 1, 2, 3]);
			});
Example #23
0
		it('should narrow when second slice is larger', function() {
			var s = slice.slice(1, 10, slice.slice(1, 5, fromArray([1])));
			expect(s.source.min).toBe(2);
			expect(s.source.max).toBe(5);
		});
Example #24
0
		return observe(function() { throw sentinel; }, s).catch(function(e) {
				expect(e).toBe(sentinel);
			});
Example #25
0
	return testEvents(function(x) {
		expect(x).toBe(sentinel);
	}, values, evented, stream).then(function (count) {
Example #26
0
		return drain(take(1, extend.cycle(s))).then(function() {
			expect(dispose).toHaveBeenCalledWith(0, 1, sentinel);
		});
Example #27
0
	}).then(function() {
		expect(spy).toHaveBeenCalled();
	});
Example #28
0
		return resolve(s.step(s.state)).then(function(event) {
			expect(event.value).toBe(sentinel);
		});
Example #29
0
			return observe(function() {
				expect(tick).toBe(1);
			}, take(1, s));
Example #30
0
			.then(function() {
				expect(y).toBe(n);
			});