From be9a5099f74d05cc7ded3939d62269f18fc96207 Mon Sep 17 00:00:00 2001 From: OJ Kwon Date: Sun, 27 Aug 2017 14:55:55 -0700 Subject: [PATCH 1/3] chore(package): bump up version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f619f23..17184ac 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rx-sandbox", - "version": "0.0.4", + "version": "0.0.5", "description": "Marble diagram DSL based test suite for RxJS 5", "main": "./dist/src/index.js", "types": "./dist/src/index.d.ts", From 4a50e5c209b719caafc6019786cc3d7000d11517 Mon Sep 17 00:00:00 2001 From: OJ Kwon Date: Sun, 27 Aug 2017 14:58:57 -0700 Subject: [PATCH 2/3] docs(readme): update advanceTo documentation --- README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/README.md b/README.md index da7c7b5..9b3acee 100644 --- a/README.md +++ b/README.md @@ -193,6 +193,25 @@ expect(messages).to.deep.equal(expected); expect(e1.subscriptions).to.deep.equal(subs); ``` +Or if you need to control timeframe instead of flush out whole at once, you can use `advanceTo` as well. + +```typescript +const e1 = hot(' --a--b--|'); +const subs = s(` ^ !`); +const messages = getMessages(e1.mapTo('x')); + +//at this moment, messages are empty! +expect(messages).to.be.empty; + +advanceTo(3); +const expected = e('--x------'); // we're flushing to frame 3 only, so rest of marbles are not constructed + +//now values are available +expect(messages).to.deep.equal(expected); +//subscriptions are also available too +expect(e1.subscriptions).to.deep.equal(subs); +``` + #### Flushing scheduler automatically By default sandbox instance requires to `flush()` explicitly to execute observables. For cases each test case doesn't require to schedule multiple observables but only need to test single, we can create sandbox instance to flush automatically. Since it flushes scheduler as soon as `getMessages` being called, subsequent `getMessages` call will raise errors. From b3315bc230e31dece407e2524b76783abd98cabc Mon Sep 17 00:00:00 2001 From: OJ Kwon Date: Sun, 27 Aug 2017 14:56:24 -0700 Subject: [PATCH 3/3] chore(release): release 0.0.5 --- CHANGELOG.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bf640c4..4c66ba7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ + +## [0.0.5](https://github.com/kwonoj/rx-sandbox/compare/v0.0.4...v0.0.5) (2017-08-27) + + +### Features + +* **advanceto:** implement advanceTo interface ([1d27849](https://github.com/kwonoj/rx-sandbox/commit/1d27849)), closes [#36](https://github.com/kwonoj/rx-sandbox/issues/36) + + + ## [0.0.4](https://github.com/kwonoj/rx-sandbox/compare/v0.0.3...v0.0.4) (2017-08-21)