rxjs-marbles
Advanced tools
Comparing version 3.0.0-rc.3 to 3.0.0-rc.4
@@ -11,2 +11,4 @@ import { Observable, SchedulerLike } from "rxjs"; | ||
private bindings_; | ||
private frameTimeFactor_; | ||
private reframable_; | ||
constructor(scheduler: TestScheduler); | ||
@@ -31,4 +33,5 @@ bind(...schedulers: SchedulerLike[]): void; | ||
}, error?: any): TestObservableLike<T>; | ||
reframe(framesPerCharacter: number, maxFrames?: number): void; | ||
teardown(): void; | ||
time(marbles: string): number; | ||
} |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var rxjs_1 = require("rxjs"); | ||
var testing_1 = require("rxjs/testing"); | ||
var args_1 = require("./args"); | ||
@@ -14,2 +15,4 @@ var assert_1 = require("./assert"); | ||
this.bindings_ = []; | ||
this.frameTimeFactor_ = undefined; | ||
this.reframable_ = true; | ||
} | ||
@@ -43,2 +46,3 @@ Context.prototype.bind = function () { | ||
var scheduler = this.scheduler; | ||
this.reframable_ = false; | ||
var observable = scheduler.createColdObservable(marbles, values, error); | ||
@@ -78,2 +82,3 @@ observable[args_1.argsSymbol] = { error: error, marbles: marbles, values: values }; | ||
var scheduler = this.scheduler; | ||
this.reframable_ = false; | ||
scheduler.flush(); | ||
@@ -88,2 +93,3 @@ }; | ||
var scheduler = this.scheduler; | ||
this.reframable_ = false; | ||
var observable = scheduler.createHotObservable(marbles, values, error); | ||
@@ -93,2 +99,15 @@ observable[args_1.argsSymbol] = { error: error, marbles: marbles, values: values }; | ||
}; | ||
Context.prototype.reframe = function (framesPerCharacter, maxFrames) { | ||
if (!this.reframable_) { | ||
throw new Error("Cannot reframe; scheduler already used."); | ||
} | ||
if (maxFrames === undefined) { | ||
maxFrames = framesPerCharacter * 75; | ||
} | ||
this.frameTimeFactor_ = rxjs_1.VirtualTimeScheduler.frameTimeFactor; | ||
rxjs_1.VirtualTimeScheduler.frameTimeFactor = framesPerCharacter; | ||
testing_1.TestScheduler.frameTimeFactor = framesPerCharacter; | ||
var scheduler = this.scheduler; | ||
scheduler.maxFrames = maxFrames; | ||
}; | ||
Context.prototype.teardown = function () { | ||
@@ -116,2 +135,6 @@ try { | ||
}); | ||
if (this.frameTimeFactor_) { | ||
rxjs_1.VirtualTimeScheduler.frameTimeFactor = this.frameTimeFactor_; | ||
testing_1.TestScheduler.frameTimeFactor = this.frameTimeFactor_; | ||
} | ||
} | ||
@@ -121,2 +144,3 @@ }; | ||
var scheduler = this.scheduler; | ||
this.reframable_ = false; | ||
return scheduler.createTime(marbles); | ||
@@ -123,0 +147,0 @@ }; |
@@ -1,2 +0,3 @@ | ||
import { animationFrameScheduler, asapScheduler, asyncScheduler, queueScheduler } from "rxjs"; | ||
import { animationFrameScheduler, asapScheduler, asyncScheduler, queueScheduler, VirtualTimeScheduler } from "rxjs"; | ||
import { TestScheduler } from "rxjs/testing"; | ||
import { argsSymbol } from "./args"; | ||
@@ -12,2 +13,4 @@ import { assertArgs, assertSubscriptions } from "./assert"; | ||
this.bindings_ = []; | ||
this.frameTimeFactor_ = undefined; | ||
this.reframable_ = true; | ||
} | ||
@@ -36,2 +39,3 @@ bind(...schedulers) { | ||
const { scheduler } = this; | ||
this.reframable_ = false; | ||
const observable = scheduler.createColdObservable(marbles, values, error); | ||
@@ -67,2 +71,3 @@ observable[argsSymbol] = { error, marbles, values }; | ||
const { scheduler } = this; | ||
this.reframable_ = false; | ||
scheduler.flush(); | ||
@@ -77,2 +82,3 @@ } | ||
const { scheduler } = this; | ||
this.reframable_ = false; | ||
const observable = scheduler.createHotObservable(marbles, values, error); | ||
@@ -82,2 +88,15 @@ observable[argsSymbol] = { error, marbles, values }; | ||
} | ||
reframe(framesPerCharacter, maxFrames) { | ||
if (!this.reframable_) { | ||
throw new Error("Cannot reframe; scheduler already used."); | ||
} | ||
if (maxFrames === undefined) { | ||
maxFrames = framesPerCharacter * 75; | ||
} | ||
this.frameTimeFactor_ = VirtualTimeScheduler.frameTimeFactor; | ||
VirtualTimeScheduler.frameTimeFactor = framesPerCharacter; | ||
TestScheduler.frameTimeFactor = framesPerCharacter; | ||
const { scheduler } = this; | ||
scheduler.maxFrames = maxFrames; | ||
} | ||
teardown() { | ||
@@ -104,2 +123,6 @@ try { | ||
}); | ||
if (this.frameTimeFactor_) { | ||
VirtualTimeScheduler.frameTimeFactor = this.frameTimeFactor_; | ||
TestScheduler.frameTimeFactor = this.frameTimeFactor_; | ||
} | ||
} | ||
@@ -109,4 +132,5 @@ } | ||
const { scheduler } = this; | ||
this.reframable_ = false; | ||
return scheduler.createTime(marbles); | ||
} | ||
} |
@@ -1,2 +0,3 @@ | ||
import { animationFrameScheduler, asapScheduler, asyncScheduler, queueScheduler } from "rxjs"; | ||
import { animationFrameScheduler, asapScheduler, asyncScheduler, queueScheduler, VirtualTimeScheduler } from "rxjs"; | ||
import { TestScheduler } from "rxjs/testing"; | ||
import { argsSymbol } from "./args"; | ||
@@ -12,2 +13,4 @@ import { assertArgs, assertSubscriptions } from "./assert"; | ||
this.bindings_ = []; | ||
this.frameTimeFactor_ = undefined; | ||
this.reframable_ = true; | ||
} | ||
@@ -41,2 +44,3 @@ Context.prototype.bind = function () { | ||
var scheduler = this.scheduler; | ||
this.reframable_ = false; | ||
var observable = scheduler.createColdObservable(marbles, values, error); | ||
@@ -76,2 +80,3 @@ observable[argsSymbol] = { error: error, marbles: marbles, values: values }; | ||
var scheduler = this.scheduler; | ||
this.reframable_ = false; | ||
scheduler.flush(); | ||
@@ -86,2 +91,3 @@ }; | ||
var scheduler = this.scheduler; | ||
this.reframable_ = false; | ||
var observable = scheduler.createHotObservable(marbles, values, error); | ||
@@ -91,2 +97,15 @@ observable[argsSymbol] = { error: error, marbles: marbles, values: values }; | ||
}; | ||
Context.prototype.reframe = function (framesPerCharacter, maxFrames) { | ||
if (!this.reframable_) { | ||
throw new Error("Cannot reframe; scheduler already used."); | ||
} | ||
if (maxFrames === undefined) { | ||
maxFrames = framesPerCharacter * 75; | ||
} | ||
this.frameTimeFactor_ = VirtualTimeScheduler.frameTimeFactor; | ||
VirtualTimeScheduler.frameTimeFactor = framesPerCharacter; | ||
TestScheduler.frameTimeFactor = framesPerCharacter; | ||
var scheduler = this.scheduler; | ||
scheduler.maxFrames = maxFrames; | ||
}; | ||
Context.prototype.teardown = function () { | ||
@@ -114,2 +133,6 @@ try { | ||
}); | ||
if (this.frameTimeFactor_) { | ||
VirtualTimeScheduler.frameTimeFactor = this.frameTimeFactor_; | ||
TestScheduler.frameTimeFactor = this.frameTimeFactor_; | ||
} | ||
} | ||
@@ -119,2 +142,3 @@ }; | ||
var scheduler = this.scheduler; | ||
this.reframable_ = false; | ||
return scheduler.createTime(marbles); | ||
@@ -121,0 +145,0 @@ }; |
@@ -46,4 +46,4 @@ { | ||
"unpkg": "./bundles/rxjs-marbles.umd.js", | ||
"version": "3.0.0-rc.3", | ||
"version": "3.0.0-rc.4", | ||
"ava": {} | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
867733
8714