rxjs-marbles
Advanced tools
Comparing version 1.5.2 to 1.6.0
@@ -2030,10 +2030,11 @@ /*MIT license https://github.com/cartant/rxjs-marbles/blob/master/LICENSE*/ | ||
var Expect = (function () { | ||
function Expect(actual, testScheduler) { | ||
function Expect(actual, testScheduler, unsubscription) { | ||
this.actual = actual; | ||
this.testScheduler = testScheduler; | ||
this.unsubscription = unsubscription; | ||
} | ||
Expect.prototype.toBeObservable = function (expected, values, error) { | ||
var _a = this, actual = _a.actual, testScheduler = _a.testScheduler; | ||
var _a = this, actual = _a.actual, testScheduler = _a.testScheduler, unsubscription = _a.unsubscription; | ||
if (typeof expected === "string") { | ||
testScheduler.expectObservable(actual).toBe(expected, values, error); | ||
testScheduler.expectObservable(actual, unsubscription).toBe(expected, values, error); | ||
} | ||
@@ -2043,3 +2044,3 @@ else { | ||
var _b = expected[argsSymbol], error_1 = _b.error, marbles = _b.marbles, values_1 = _b.values; | ||
testScheduler.expectObservable(actual).toBe(marbles, values_1, error_1); | ||
testScheduler.expectObservable(actual, unsubscription).toBe(marbles, values_1, error_1); | ||
} | ||
@@ -2066,16 +2067,29 @@ }; | ||
}; | ||
Context.prototype.equal = function (actual, expected, values, error) { | ||
Context.prototype.equal = function (actual) { | ||
var args = []; | ||
for (var _i = 1; _i < arguments.length; _i++) { | ||
args[_i - 1] = arguments[_i]; | ||
} | ||
var testScheduler = this.testScheduler; | ||
if (typeof expected === "string") { | ||
testScheduler.expectObservable(actual).toBe(expected, values, error); | ||
var a0 = args[0], a1 = args[1], a2 = args[2], a3 = args[3]; | ||
if (a1 && (typeof a1 === "string")) { | ||
testScheduler.expectObservable(actual, a0).toBe(a1, a2, a3); | ||
} | ||
else if (a1 && a1[argsSymbol]) { | ||
assertArgs(a1); | ||
var _a = a1[argsSymbol], error = _a.error, marbles = _a.marbles, values = _a.values; | ||
testScheduler.expectObservable(actual, a0).toBe(marbles, values, error); | ||
} | ||
else if (typeof a0 === "string") { | ||
testScheduler.expectObservable(actual).toBe(a0, a1, a2); | ||
} | ||
else { | ||
assertArgs(expected); | ||
var _a = expected[argsSymbol], error_1 = _a.error, marbles = _a.marbles, values_1 = _a.values; | ||
testScheduler.expectObservable(actual).toBe(marbles, values_1, error_1); | ||
assertArgs(a0); | ||
var _b = a0[argsSymbol], error = _b.error, marbles = _b.marbles, values = _b.values; | ||
testScheduler.expectObservable(actual).toBe(marbles, values, error); | ||
} | ||
}; | ||
Context.prototype.expect = function (actual) { | ||
Context.prototype.expect = function (actual, unsubscription) { | ||
var testScheduler = this.testScheduler; | ||
return new Expect(actual, testScheduler); | ||
return new Expect(actual, testScheduler, unsubscription); | ||
}; | ||
@@ -2082,0 +2096,0 @@ Context.prototype.flush = function () { |
@@ -2030,10 +2030,11 @@ /*MIT license https://github.com/cartant/rxjs-marbles/blob/master/LICENSE*/ | ||
var Expect = (function () { | ||
function Expect(actual, testScheduler) { | ||
function Expect(actual, testScheduler, unsubscription) { | ||
this.actual = actual; | ||
this.testScheduler = testScheduler; | ||
this.unsubscription = unsubscription; | ||
} | ||
Expect.prototype.toBeObservable = function (expected, values, error) { | ||
var _a = this, actual = _a.actual, testScheduler = _a.testScheduler; | ||
var _a = this, actual = _a.actual, testScheduler = _a.testScheduler, unsubscription = _a.unsubscription; | ||
if (typeof expected === "string") { | ||
testScheduler.expectObservable(actual).toBe(expected, values, error); | ||
testScheduler.expectObservable(actual, unsubscription).toBe(expected, values, error); | ||
} | ||
@@ -2043,3 +2044,3 @@ else { | ||
var _b = expected[argsSymbol], error_1 = _b.error, marbles = _b.marbles, values_1 = _b.values; | ||
testScheduler.expectObservable(actual).toBe(marbles, values_1, error_1); | ||
testScheduler.expectObservable(actual, unsubscription).toBe(marbles, values_1, error_1); | ||
} | ||
@@ -2066,16 +2067,29 @@ }; | ||
}; | ||
Context.prototype.equal = function (actual, expected, values, error) { | ||
Context.prototype.equal = function (actual) { | ||
var args = []; | ||
for (var _i = 1; _i < arguments.length; _i++) { | ||
args[_i - 1] = arguments[_i]; | ||
} | ||
var testScheduler = this.testScheduler; | ||
if (typeof expected === "string") { | ||
testScheduler.expectObservable(actual).toBe(expected, values, error); | ||
var a0 = args[0], a1 = args[1], a2 = args[2], a3 = args[3]; | ||
if (a1 && (typeof a1 === "string")) { | ||
testScheduler.expectObservable(actual, a0).toBe(a1, a2, a3); | ||
} | ||
else if (a1 && a1[argsSymbol]) { | ||
assertArgs(a1); | ||
var _a = a1[argsSymbol], error = _a.error, marbles = _a.marbles, values = _a.values; | ||
testScheduler.expectObservable(actual, a0).toBe(marbles, values, error); | ||
} | ||
else if (typeof a0 === "string") { | ||
testScheduler.expectObservable(actual).toBe(a0, a1, a2); | ||
} | ||
else { | ||
assertArgs(expected); | ||
var _a = expected[argsSymbol], error_1 = _a.error, marbles = _a.marbles, values_1 = _a.values; | ||
testScheduler.expectObservable(actual).toBe(marbles, values_1, error_1); | ||
assertArgs(a0); | ||
var _b = a0[argsSymbol], error = _b.error, marbles = _b.marbles, values = _b.values; | ||
testScheduler.expectObservable(actual).toBe(marbles, values, error); | ||
} | ||
}; | ||
Context.prototype.expect = function (actual) { | ||
Context.prototype.expect = function (actual, unsubscription) { | ||
var testScheduler = this.testScheduler; | ||
return new Expect(actual, testScheduler); | ||
return new Expect(actual, testScheduler, unsubscription); | ||
}; | ||
@@ -2082,0 +2096,0 @@ Context.prototype.flush = function () { |
@@ -2030,10 +2030,11 @@ /*MIT license https://github.com/cartant/rxjs-marbles/blob/master/LICENSE*/ | ||
var Expect = (function () { | ||
function Expect(actual, testScheduler) { | ||
function Expect(actual, testScheduler, unsubscription) { | ||
this.actual = actual; | ||
this.testScheduler = testScheduler; | ||
this.unsubscription = unsubscription; | ||
} | ||
Expect.prototype.toBeObservable = function (expected, values, error) { | ||
var _a = this, actual = _a.actual, testScheduler = _a.testScheduler; | ||
var _a = this, actual = _a.actual, testScheduler = _a.testScheduler, unsubscription = _a.unsubscription; | ||
if (typeof expected === "string") { | ||
testScheduler.expectObservable(actual).toBe(expected, values, error); | ||
testScheduler.expectObservable(actual, unsubscription).toBe(expected, values, error); | ||
} | ||
@@ -2043,3 +2044,3 @@ else { | ||
var _b = expected[argsSymbol], error_1 = _b.error, marbles = _b.marbles, values_1 = _b.values; | ||
testScheduler.expectObservable(actual).toBe(marbles, values_1, error_1); | ||
testScheduler.expectObservable(actual, unsubscription).toBe(marbles, values_1, error_1); | ||
} | ||
@@ -2066,16 +2067,29 @@ }; | ||
}; | ||
Context.prototype.equal = function (actual, expected, values, error) { | ||
Context.prototype.equal = function (actual) { | ||
var args = []; | ||
for (var _i = 1; _i < arguments.length; _i++) { | ||
args[_i - 1] = arguments[_i]; | ||
} | ||
var testScheduler = this.testScheduler; | ||
if (typeof expected === "string") { | ||
testScheduler.expectObservable(actual).toBe(expected, values, error); | ||
var a0 = args[0], a1 = args[1], a2 = args[2], a3 = args[3]; | ||
if (a1 && (typeof a1 === "string")) { | ||
testScheduler.expectObservable(actual, a0).toBe(a1, a2, a3); | ||
} | ||
else if (a1 && a1[argsSymbol]) { | ||
assertArgs(a1); | ||
var _a = a1[argsSymbol], error = _a.error, marbles = _a.marbles, values = _a.values; | ||
testScheduler.expectObservable(actual, a0).toBe(marbles, values, error); | ||
} | ||
else if (typeof a0 === "string") { | ||
testScheduler.expectObservable(actual).toBe(a0, a1, a2); | ||
} | ||
else { | ||
assertArgs(expected); | ||
var _a = expected[argsSymbol], error_1 = _a.error, marbles = _a.marbles, values_1 = _a.values; | ||
testScheduler.expectObservable(actual).toBe(marbles, values_1, error_1); | ||
assertArgs(a0); | ||
var _b = a0[argsSymbol], error = _b.error, marbles = _b.marbles, values = _b.values; | ||
testScheduler.expectObservable(actual).toBe(marbles, values, error); | ||
} | ||
}; | ||
Context.prototype.expect = function (actual) { | ||
Context.prototype.expect = function (actual, unsubscription) { | ||
var testScheduler = this.testScheduler; | ||
return new Expect(actual, testScheduler); | ||
return new Expect(actual, testScheduler, unsubscription); | ||
}; | ||
@@ -2082,0 +2096,0 @@ Context.prototype.flush = function () { |
@@ -0,1 +1,8 @@ | ||
<a name="1.6.0"></a> | ||
## [1.6.0](https://github.com/cartant/rxjs-marbles/compare/v1.5.2...v1.6.0) (2017-08-08) | ||
### Features | ||
* **expect**: Add support for unsubscription strings. ([a9a839d](https://github.com/cartant/rxjs-marbles/commit/a9a839d)) | ||
<a name="1.5.2"></a> | ||
@@ -2,0 +9,0 @@ ## [1.5.2](https://github.com/cartant/rxjs-marbles/compare/v1.5.1...v1.5.2) (2017-07-29) |
@@ -18,3 +18,7 @@ import { Observable } from "rxjs/Observable"; | ||
}, error?: any): void; | ||
expect<T = any>(actual: Observable<T>): Expect<T>; | ||
equal<T = any>(actual: Observable<T>, unsubscription: string, expected: Observable<T>): void; | ||
equal<T = any>(actual: Observable<T>, unsubscription: string, expected: string, values?: { | ||
[key: string]: T; | ||
}, error?: any): void; | ||
expect<T = any>(actual: Observable<T>, unsubscription?: string): Expect<T>; | ||
flush(): void; | ||
@@ -21,0 +25,0 @@ has<T = any>(actual: Observable<T>, expected: string | string[]): void; |
@@ -16,16 +16,29 @@ import { argsSymbol } from "./args"; | ||
}; | ||
Context.prototype.equal = function (actual, expected, values, error) { | ||
Context.prototype.equal = function (actual) { | ||
var args = []; | ||
for (var _i = 1; _i < arguments.length; _i++) { | ||
args[_i - 1] = arguments[_i]; | ||
} | ||
var testScheduler = this.testScheduler; | ||
if (typeof expected === "string") { | ||
testScheduler.expectObservable(actual).toBe(expected, values, error); | ||
var a0 = args[0], a1 = args[1], a2 = args[2], a3 = args[3]; | ||
if (a1 && (typeof a1 === "string")) { | ||
testScheduler.expectObservable(actual, a0).toBe(a1, a2, a3); | ||
} | ||
else if (a1 && a1[argsSymbol]) { | ||
assertArgs(a1); | ||
var _a = a1[argsSymbol], error = _a.error, marbles = _a.marbles, values = _a.values; | ||
testScheduler.expectObservable(actual, a0).toBe(marbles, values, error); | ||
} | ||
else if (typeof a0 === "string") { | ||
testScheduler.expectObservable(actual).toBe(a0, a1, a2); | ||
} | ||
else { | ||
assertArgs(expected); | ||
var _a = expected[argsSymbol], error_1 = _a.error, marbles = _a.marbles, values_1 = _a.values; | ||
testScheduler.expectObservable(actual).toBe(marbles, values_1, error_1); | ||
assertArgs(a0); | ||
var _b = a0[argsSymbol], error = _b.error, marbles = _b.marbles, values = _b.values; | ||
testScheduler.expectObservable(actual).toBe(marbles, values, error); | ||
} | ||
}; | ||
Context.prototype.expect = function (actual) { | ||
Context.prototype.expect = function (actual, unsubscription) { | ||
var testScheduler = this.testScheduler; | ||
return new Expect(actual, testScheduler); | ||
return new Expect(actual, testScheduler, unsubscription); | ||
}; | ||
@@ -32,0 +45,0 @@ Context.prototype.flush = function () { |
@@ -7,3 +7,4 @@ import { ColdObservable } from "rxjs/testing/ColdObservable"; | ||
private testScheduler; | ||
constructor(actual: ColdObservable<T> | HotObservable<T>, testScheduler: TestScheduler); | ||
private unsubscription; | ||
constructor(actual: ColdObservable<T> | HotObservable<T>, testScheduler: TestScheduler, unsubscription?: string | undefined); | ||
toBeObservable(expected: ColdObservable<T> | HotObservable<T>): void; | ||
@@ -10,0 +11,0 @@ toBeObservable(expected: string, values?: { |
import { argsSymbol } from "./args"; | ||
import { assertArgs, assertSubscriptions } from "./assert"; | ||
var Expect = (function () { | ||
function Expect(actual, testScheduler) { | ||
function Expect(actual, testScheduler, unsubscription) { | ||
this.actual = actual; | ||
this.testScheduler = testScheduler; | ||
this.unsubscription = unsubscription; | ||
} | ||
Expect.prototype.toBeObservable = function (expected, values, error) { | ||
var _a = this, actual = _a.actual, testScheduler = _a.testScheduler; | ||
var _a = this, actual = _a.actual, testScheduler = _a.testScheduler, unsubscription = _a.unsubscription; | ||
if (typeof expected === "string") { | ||
testScheduler.expectObservable(actual).toBe(expected, values, error); | ||
testScheduler.expectObservable(actual, unsubscription).toBe(expected, values, error); | ||
} | ||
@@ -16,3 +17,3 @@ else { | ||
var _b = expected[argsSymbol], error_1 = _b.error, marbles = _b.marbles, values_1 = _b.values; | ||
testScheduler.expectObservable(actual).toBe(marbles, values_1, error_1); | ||
testScheduler.expectObservable(actual, unsubscription).toBe(marbles, values_1, error_1); | ||
} | ||
@@ -19,0 +20,0 @@ }; |
@@ -43,4 +43,4 @@ { | ||
"unpkg": "./bundles/rxjs-marbles.umd.js", | ||
"version": "1.5.2", | ||
"version": "1.6.0", | ||
"ava": {} | ||
} |
@@ -68,3 +68,3 @@ # rxjs-marbles | ||
As with Jasmine and Mocha, instead of passing your test function directly to Jest, pass it to the library's `marbles` function: | ||
Instead of passing your test function directly to Jest, pass it to the library's `marbles` function: | ||
@@ -95,3 +95,3 @@ ```ts | ||
As with Jasmine and Mocha, instead of passing your test function directly to AVA, pass it to the library's `marbles` function. The `marbles` function will concatenate the additional `TestContext` argument it receives from AVA. | ||
Instead of passing your test function directly to AVA, pass it to the library's `marbles` function. The `marbles` function will concatenate the additional `TestContext` argument it receives from AVA. | ||
@@ -128,3 +128,3 @@ There is an `/ava` directory in the package that includes a wrapper that will correctly type additional argument and will call `configure` - passing AVA's assertion methods to ensure marble assertions will be counted towards AVA's `plan` - so be sure to specify `rxjs-marbles/ava` in the `import` statement or `require` call: | ||
As with Jasmine and Mocha, instead of passing your test function directly to Tape, pass it to the library's `marbles` function. The `marbles` function will concatenate the additional `Test` argument it receives from Tape. | ||
Instead of passing your test function directly to Tape, pass it to the library's `marbles` function. The `marbles` function will concatenate the additional `Test` argument it receives from Tape. | ||
@@ -215,3 +215,5 @@ There is a `/tape` directory in the package that includes a wrapper that will correctly type additional argument and will call `configure` - passing Tape's assertion methods to ensure marble assertions will be counted towards Tape's `plan` - so be sure to specify `rxjs-marbles/tape` in the `import` statement or `require` call: | ||
equal<T = any>(actual: Observable<T>, expected: string, values?: { [key: string]: T }, error?: any): void; | ||
expect<T = any>(actual: Observable<T>): Expect<T>; | ||
equal<T = any>(actual: Observable<T>, unsubscription: string, expected: Observable<T>): void; | ||
equal<T = any>(actual: Observable<T>, unsubscription: string, expected: string, values?: { [key: string]: T }, error?: any): void; | ||
expect<T = any>(actual: Observable<T>, unsubscription?: string): Expect<T>; | ||
flush(): void; | ||
@@ -218,0 +220,0 @@ has<T = any>(actual: Observable<T>, expected: string | string[]): void; |
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
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
216620
6237
227