diff --git a/CHANGELOG.md b/CHANGELOG.md
index d17f7f3..a63dba2 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,24 @@
+
+# [2.0.0-beta.1](https://github.com/kwonoj/rx-sandbox/compare/v1.0.3...v2.0.0-beta.1) (2020-06-02)
+
+
+### build
+
+* **tsconfig:** update tsconfig ([748ea40](https://github.com/kwonoj/rx-sandbox/commit/748ea40))
+
+
+### Features
+
+* **sandbox:** support 7.x ([d8220f8](https://github.com/kwonoj/rx-sandbox/commit/d8220f8))
+
+
+### BREAKING CHANGES
+
+* **tsconfig:** require es2015 supported runtime
+* **sandb8x:** require rx >= 7.x
+
+
+
## [1.0.3](https://github.com/kwonoj/rx-sandbox/compare/v1.0.2...v1.0.3) (2019-06-23)
diff --git a/jest.json b/jest.json
index 058fcad..8a6df03 100644
--- a/jest.json
+++ b/jest.json
@@ -3,6 +3,11 @@
"testMatch": [
"**/spec/**/*-spec.ts"
],
+ "globals": {
+ "ts-jest": {
+ "diagnostics": false
+ }
+ },
"bail": true,
"resetMocks": true,
"clearMocks": true,
diff --git a/package-lock.json b/package-lock.json
index 247eb33..5eac9b0 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,6 +1,6 @@
{
"name": "rx-sandbox",
- "version": "1.0.3",
+ "version": "2.0.0-beta.1",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@@ -6095,6 +6095,15 @@
"integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=",
"dev": true
},
+ "rxjs": {
+ "version": "6.5.5",
+ "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.5.tgz",
+ "integrity": "sha512-WfQI+1gohdf0Dai/Bbmk5L5ItH5tYqm3ki2c5GdWhKjalzjg93N3avFjVStyZZz+A2Em+ZxKH5bNghw9UeylGQ==",
+ "dev": true,
+ "requires": {
+ "tslib": "^1.9.0"
+ }
+ },
"strip-ansi": {
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz",
@@ -9521,6 +9530,15 @@
"resolved": "https://registry.npmjs.org/p-map/-/p-map-2.1.0.tgz",
"integrity": "sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==",
"dev": true
+ },
+ "rxjs": {
+ "version": "6.5.5",
+ "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.5.tgz",
+ "integrity": "sha512-WfQI+1gohdf0Dai/Bbmk5L5ItH5tYqm3ki2c5GdWhKjalzjg93N3avFjVStyZZz+A2Em+ZxKH5bNghw9UeylGQ==",
+ "dev": true,
+ "requires": {
+ "tslib": "^1.9.0"
+ }
}
}
},
@@ -11353,9 +11371,9 @@
"dev": true
},
"rxjs": {
- "version": "6.5.5",
- "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.5.tgz",
- "integrity": "sha512-WfQI+1gohdf0Dai/Bbmk5L5ItH5tYqm3ki2c5GdWhKjalzjg93N3avFjVStyZZz+A2Em+ZxKH5bNghw9UeylGQ==",
+ "version": "7.0.0-beta.0",
+ "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.0.0-beta.0.tgz",
+ "integrity": "sha512-MMsqDczs2RzsTvBiH6SKjJkdAh7WaI6Q0axP/DX+1ljwFm6+18AhQ3kVT8gD7G0dHIVfh5hDFoqLaW79pkiGag==",
"dev": true,
"requires": {
"tslib": "^1.9.0"
diff --git a/package.json b/package.json
index e701690..4058f7a 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "rx-sandbox",
- "version": "1.0.3",
+ "version": "2.0.0-beta.1",
"description": "Marble diagram DSL based test suite for RxJS 6",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
@@ -61,7 +61,7 @@
"lint-staged": "^9.5.0",
"npm-run-all": "^4.1.5",
"prettier": "^2.0.5",
- "rxjs": "^6.5.5",
+ "rxjs": "^7.0.0-beta.0",
"shx": "^0.3.2",
"ts-jest": "^26.1.0",
"tslint": "^6.1.2",
@@ -69,7 +69,7 @@
"typescript": "^3.9.3"
},
"peerDependencies": {
- "rxjs": "6.x"
+ "rxjs": "7.x"
},
"dependencies": {
"jest-matcher-utils": "^26.0.1",
diff --git a/spec/marbles/parseObservableMarble-spec.ts b/spec/marbles/parseObservableMarble-spec.ts
index 1794ac7..15f0ef8 100644
--- a/spec/marbles/parseObservableMarble-spec.ts
+++ b/spec/marbles/parseObservableMarble-spec.ts
@@ -1,9 +1,16 @@
import { expect } from 'chai';
-import { ColdObservable } from 'rxjs/internal/testing/ColdObservable';
import { parseObservableMarble } from '../../src/marbles/parseObservableMarble';
import { complete, error, next } from '../../src/message/TestMessage';
import { TestScheduler } from '../../src/scheduler/TestScheduler';
+//tslint:disable no-var-requires no-require-imports
+const {
+ ColdObservable,
+}: {
+ ColdObservable: typeof import('rxjs/dist/types/internal/testing/ColdObservable').ColdObservable;
+} = require('rxjs/dist/cjs/internal/testing/ColdObservable');
+//tslint:enable no-var-requires no-require-imports
+
describe('parseObservableMarble', () => {
it('should not allow unsubscription token', () => {
const marble = '----!';
@@ -52,7 +59,7 @@ describe('parseObservableMarble', () => {
const customValue = {
a: new ColdObservable(aMessages, null as any),
- b: new ColdObservable(bMessages, null as any)
+ b: new ColdObservable(bMessages, null as any),
};
const messages = parseObservableMarble(marble, customValue, null, true);
@@ -68,7 +75,7 @@ describe('parseObservableMarble', () => {
const customValue = {
a: new ColdObservable(aMessages, null as any),
- b: new ColdObservable(bMessages, null as any)
+ b: new ColdObservable(bMessages, null as any),
};
const messages = parseObservableMarble(marble, customValue, null, false);
@@ -107,7 +114,7 @@ describe('parseObservableMarble', () => {
it('should parse value literal with custom value', () => {
const marble = '----a----';
const customValue = {
- a: 'qwerty'
+ a: 'qwerty',
};
const messages = parseObservableMarble(marble, customValue);
diff --git a/spec/scheduler/TestScheduler-spec.ts b/spec/scheduler/TestScheduler-spec.ts
index d48b20a..a37ec3d 100644
--- a/spec/scheduler/TestScheduler-spec.ts
+++ b/spec/scheduler/TestScheduler-spec.ts
@@ -1,12 +1,27 @@
import { expect } from 'chai';
-import { AsyncAction } from 'rxjs/internal/scheduler/AsyncAction';
-import { ColdObservable } from 'rxjs/internal/testing/ColdObservable';
-import { HotObservable } from 'rxjs/internal/testing/HotObservable';
import { mapTo, windowCount } from 'rxjs/operators';
import { parseObservableMarble } from '../../src/marbles/parseObservableMarble';
import { complete, error, next, subscribe, TestMessage } from '../../src/message/TestMessage';
import { TestScheduler } from '../../src/scheduler/TestScheduler';
+//tslint:disable no-var-requires no-require-imports
+const {
+ AsyncAction,
+}: {
+ AsyncAction: typeof import('rxjs/dist/types/internal/scheduler/AsyncAction').AsyncAction;
+} = require('rxjs/dist/cjs/internal/scheduler/AsyncAction');
+const {
+ ColdObservable,
+}: {
+ ColdObservable: typeof import('rxjs/dist/types/internal/testing/ColdObservable').ColdObservable;
+} = require('rxjs/dist/cjs/internal/testing/ColdObservable');
+const {
+ HotObservable,
+}: {
+ HotObservable: typeof import('rxjs/dist/types/internal/testing/HotObservable').HotObservable;
+} = require('rxjs/dist/cjs/internal/testing/HotObservable');
+//tslint:enable no-var-requires no-require-imports
+
describe('TestScheduler', () => {
describe('hotObservable', () => {
it('should create hot observable via TestMessage', () => {
diff --git a/src/RxSandbox.ts b/src/RxSandbox.ts
index 10fe9f9..993b5c5 100644
--- a/src/RxSandbox.ts
+++ b/src/RxSandbox.ts
@@ -1,4 +1,4 @@
-import { SubscriptionLog } from 'rxjs/internal/testing/SubscriptionLog';
+import { SubscriptionLog } from 'rxjs/dist/types/internal/testing/SubscriptionLog';
import { TestMessage } from './message/TestMessage';
import { RxSandboxInstance } from './RxSandboxInstance';
diff --git a/src/RxSandboxInstance.ts b/src/RxSandboxInstance.ts
index 62f0538..21f18c3 100644
--- a/src/RxSandboxInstance.ts
+++ b/src/RxSandboxInstance.ts
@@ -1,4 +1,4 @@
-import { SubscriptionLog } from 'rxjs/internal/testing/SubscriptionLog';
+import { SubscriptionLog } from 'rxjs/dist/types/internal/testing/SubscriptionLog';
import { TestMessage } from './message/TestMessage';
import { TestScheduler } from './scheduler/TestScheduler';
@@ -59,5 +59,5 @@ export {
getObservableMessage,
expectedObservable,
expectedSubscription,
- RxSandboxInstance
+ RxSandboxInstance,
};
diff --git a/src/assert/constructSubscriptionMarble.ts b/src/assert/constructSubscriptionMarble.ts
index c8bbb3a..1a2d661 100644
--- a/src/assert/constructSubscriptionMarble.ts
+++ b/src/assert/constructSubscriptionMarble.ts
@@ -1,4 +1,4 @@
-import { SubscriptionLog } from 'rxjs/internal/testing/SubscriptionLog';
+import { SubscriptionLog } from 'rxjs/dist/types/internal/testing/SubscriptionLog';
import { ObservableMarbleToken } from '../marbles/ObservableMarbleToken';
import { SubscriptionMarbleToken } from '../marbles/SubscriptionMarbleToken';
@@ -9,7 +9,7 @@ const MAX_FRAME_LENGTH = 30;
*/
const constructSubscriptionMarble = ({
subscribedFrame,
- unsubscribedFrame
+ unsubscribedFrame,
}: SubscriptionLog): { marbleString: string; frameString: string } => {
const marble: Array = Array.from(Array(MAX_FRAME_LENGTH + 1)).map(
() => ObservableMarbleToken.TIMEFRAME
diff --git a/src/assert/marbleAssert.ts b/src/assert/marbleAssert.ts
index a31248d..56af178 100644
--- a/src/assert/marbleAssert.ts
+++ b/src/assert/marbleAssert.ts
@@ -1,13 +1,18 @@
import { toEqual } from 'jest-matchers/build/matchers';
-import { SubscriptionLog } from 'rxjs/internal/testing/SubscriptionLog';
import { TestMessage } from '../message/TestMessage';
import { constructObservableMarble } from './constructObservableMarble';
import { constructSubscriptionMarble } from './constructSubscriptionMarble';
-const { matcherHint, printExpected, printReceived } = require('jest-matcher-utils'); //tslint:disable-line:no-require-imports no-var-requires
+
+//tslint:disable:no-require-imports no-var-requires
+const { matcherHint, printExpected, printReceived } = require('jest-matcher-utils');
+const { SubscriptionLog } = require('rxjs/dist/cjs/internal/testing/SubscriptionLog');
+//tslint:enbale:no-require-imports no-var-requires
const toEqualAssert = toEqual.bind({ expand: false });
-const subscriptionMarbleAssert = (source: Array) => (expected: Array) => {
+const subscriptionMarbleAssert = (
+ source: Array
+) => (expected: Array) => {
const asserted = toEqualAssert(source, expected);
if (!asserted.pass) {
@@ -52,6 +57,7 @@ const observableMarbleAssert = (source: Array> | Read
//polymorphic picks up observablemarbleassert first when empty array, manually falls back
//if expected is subscriptionlog
+ //tslint:disable-next-line no-var-requires no-require-imports
if ((expected as any).every((x: any) => x instanceof SubscriptionLog)) {
subscriptionMarbleAssert(source as any)(expected as any);
return;
@@ -83,11 +89,11 @@ function marbleAssert(
};
};
function marbleAssert(
- source: Array
-): { to: { equal(expected: Array): void } };
+ source: Array
+): { to: { equal(expected: Array): void } };
function marbleAssert(
source:
- | Array
+ | Array
| Array>>>
| Readonly>>>>
): { to: { equal(expected: object): void } } {
@@ -96,12 +102,12 @@ function marbleAssert(
throw new Error('Cannot assert non array');
}
- const isSourceSubscription = source.length > 0 && (source as Array).every(v => v instanceof SubscriptionLog);
+ const isSourceSubscription = source.length > 0 && (source as Array).every((v) => v instanceof SubscriptionLog);
return {
to: {
- equal: isSourceSubscription ? subscriptionMarbleAssert(source as any) : observableMarbleAssert(source as any)
- }
+ equal: isSourceSubscription ? subscriptionMarbleAssert(source as any) : observableMarbleAssert(source as any),
+ },
};
}
diff --git a/src/index.ts b/src/index.ts
index fd6e80b..411b846 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -1,6 +1,3 @@
-import { Observable } from 'rxjs';
-import { ColdObservable } from 'rxjs/internal/testing/ColdObservable';
-import { HotObservable } from 'rxjs/internal/testing/HotObservable';
import { marbleAssert } from './assert/marbleAssert';
import { parseObservableMarble } from './marbles/parseObservableMarble';
import { parseSubscriptionMarble } from './marbles/parseSubscriptionMarble';
@@ -16,14 +13,9 @@ export {
getObservableMessage,
expectedObservable,
expectedSubscription,
- RxSandboxInstance
+ RxSandboxInstance,
} from './RxSandboxInstance';
-//workaround TS4029 by explicitly import types and avoid unused import error
-(() => Observable.toString())();
-(() => ColdObservable.toString())();
-(() => HotObservable.toString())();
-
type marbleAssertion = typeof marbleAssert;
const rxSandbox: RxSandbox = {
@@ -39,10 +31,10 @@ const rxSandbox: RxSandbox = {
getMessages: scheduler.getMessages.bind(scheduler) as typeof scheduler.getMessages,
e: (marble: string, value?: { [key: string]: T } | null, error?: any) =>
parseObservableMarble(marble, value, error, true, frameTimeFactor, frameTimeFactor * maxFrameValue),
- s: (marble: string) => parseSubscriptionMarble(marble, frameTimeFactor, frameTimeFactor * maxFrameValue)
+ s: (marble: string) => parseSubscriptionMarble(marble, frameTimeFactor, frameTimeFactor * maxFrameValue),
};
},
- marbleAssert: marbleAssert
+ marbleAssert: marbleAssert,
};
export { rxSandbox, TestMessage, marbleAssertion, next, error, complete, subscribe };
diff --git a/src/marbles/parseSubscriptionMarble.ts b/src/marbles/parseSubscriptionMarble.ts
index 27d2b33..7902ea4 100644
--- a/src/marbles/parseSubscriptionMarble.ts
+++ b/src/marbles/parseSubscriptionMarble.ts
@@ -1,20 +1,27 @@
-import { SubscriptionLog } from 'rxjs/internal/testing/SubscriptionLog';
import { ObservableMarbleToken } from './ObservableMarbleToken';
import { subscriptionTokenParseReducer } from './tokenParseReducer';
+//tslint:disable no-var-requires no-require-imports
+const {
+ SubscriptionLog,
+}: {
+ SubscriptionLog: typeof import('rxjs/dist/types/internal/testing/SubscriptionLog').SubscriptionLog;
+} = require('rxjs/dist/cjs/internal/testing/SubscriptionLog');
+//tslint:enable no-var-requires no-require-imports
+
const parseSubscriptionMarble = (marble: string | null, frameTimeFactor: number = 1, maxFrame = 1000) => {
if (!marble) {
return new SubscriptionLog(Number.POSITIVE_INFINITY);
}
- const marbleTokenArray = Array.from(marble).filter(token => token !== ObservableMarbleToken.NOOP);
+ const marbleTokenArray = Array.from(marble).filter((token) => token !== ObservableMarbleToken.NOOP);
const value = marbleTokenArray.reduce(subscriptionTokenParseReducer(frameTimeFactor, maxFrame), {
currentTimeFrame: 0,
subscriptionFrame: Number.POSITIVE_INFINITY,
unsubscriptionFrame: Number.POSITIVE_INFINITY,
simultaneousGrouped: false,
expandingTokenCount: 0,
- expandingValue: []
+ expandingValue: [],
});
return value.unsubscriptionFrame === Number.POSITIVE_INFINITY
diff --git a/src/marbles/tokenParseReducer.ts b/src/marbles/tokenParseReducer.ts
index bc39b2f..c4dc993 100644
--- a/src/marbles/tokenParseReducer.ts
+++ b/src/marbles/tokenParseReducer.ts
@@ -1,8 +1,15 @@
-import { ColdObservable } from 'rxjs/internal/testing/ColdObservable';
import { complete, error as e, next, TestMessage } from '../message/TestMessage';
import { ObservableMarbleToken } from './ObservableMarbleToken';
import { SubscriptionMarbleToken } from './SubscriptionMarbleToken';
+//tslint:disable no-var-requires no-require-imports
+const {
+ ColdObservable,
+}: {
+ ColdObservable: typeof import('rxjs/dist/types/internal/testing/ColdObservable').ColdObservable;
+} = require('rxjs/dist/cjs/internal/testing/ColdObservable');
+//tslint:enable no-var-requires no-require-imports
+
/**
* @internal
* Base accumulator interface for parsing marble diagram.
@@ -219,5 +226,5 @@ export {
ObservableTokenParseAccumulator,
SubscriptionTokenParseAccumulator,
subscriptionTokenParseReducer,
- observableTokenParseReducer
+ observableTokenParseReducer,
};
diff --git a/src/message/TestMessage.ts b/src/message/TestMessage.ts
index e90dd63..2295aae 100644
--- a/src/message/TestMessage.ts
+++ b/src/message/TestMessage.ts
@@ -1,5 +1,12 @@
import { Notification } from 'rxjs';
-import { SubscriptionLog } from 'rxjs/internal/testing/SubscriptionLog';
+
+//tslint:disable no-var-requires no-require-imports
+const {
+ SubscriptionLog,
+}: {
+ SubscriptionLog: typeof import('rxjs/dist/types/internal/testing/SubscriptionLog').SubscriptionLog;
+} = require('rxjs/dist/cjs/internal/testing/SubscriptionLog');
+//tslint:enable no-var-requires no-require-imports
/**
* Represents interface for single metadata value emitted by HotObservable or ColdObservable
diff --git a/src/scheduler/TestScheduler.ts b/src/scheduler/TestScheduler.ts
index c89b2ff..c9c2a40 100644
--- a/src/scheduler/TestScheduler.ts
+++ b/src/scheduler/TestScheduler.ts
@@ -1,23 +1,34 @@
import { Notification, Observable, Subscription } from 'rxjs';
-import { AsyncAction } from 'rxjs/internal/scheduler/AsyncAction';
-import {
- VirtualAction,
- VirtualTimeScheduler
-} from 'rxjs/internal/scheduler/VirtualTimeScheduler';
-import { ColdObservable } from 'rxjs/internal/testing/ColdObservable';
-import { HotObservable } from 'rxjs/internal/testing/HotObservable';
+import { AsyncAction } from 'rxjs/dist/types/internal/scheduler/AsyncAction';
import { parseObservableMarble } from '../marbles/parseObservableMarble';
import { SubscriptionMarbleToken } from '../marbles/SubscriptionMarbleToken';
import { TestMessage } from '../message/TestMessage';
import { TestMessageValue } from '../message/TestMessage';
import { calculateSubscriptionFrame } from './calculateSubscriptionFrame';
+//tslint:disable no-var-requires no-require-imports
+const {
+ VirtualAction,
+ VirtualTimeScheduler,
+}: {
+ VirtualAction: typeof import('rxjs/dist/types/internal/scheduler/VirtualTimeScheduler').VirtualAction;
+ VirtualTimeScheduler: typeof import('rxjs/dist/types/internal/scheduler/VirtualTimeScheduler').VirtualTimeScheduler;
+} = require('rxjs/dist/cjs/internal/scheduler/VirtualTimeScheduler');
+
+const hotObservableCtor = require('rxjs/dist/cjs/internal/testing/HotObservable').HotObservable;
+const coldObservableCtor = require('rxjs/dist/cjs/internal/testing/ColdObservable').ColdObservable;
+//tslint:enable no-var-requires no-require-imports
+
/**
* @internal
*/
class TestScheduler extends VirtualTimeScheduler {
- private readonly coldObservables: Array> = [];
- private readonly hotObservables: Array> = [];
+ private readonly coldObservables: Array<
+ import('rxjs/dist/types/internal/testing/ColdObservable').ColdObservable
+ > = [];
+ private readonly hotObservables: Array<
+ import('rxjs/dist/types/internal/testing/HotObservable').HotObservable
+ > = [];
private flushed: boolean = false;
private flushing: boolean = false;
@@ -75,9 +86,17 @@ class TestScheduler extends VirtualTimeScheduler {
return observableMetadata;
}
- public createColdObservable(marble: string, value?: { [key: string]: T } | null, error?: any): ColdObservable;
- public createColdObservable(message: Array>): ColdObservable;
- public createColdObservable(...args: Array): ColdObservable {
+ public createColdObservable(
+ marble: string,
+ value?: { [key: string]: T } | null,
+ error?: any
+ ): import('rxjs/dist/types/internal/testing/ColdObservable').ColdObservable;
+ public createColdObservable(
+ message: Array>
+ ): import('rxjs/dist/types/internal/testing/ColdObservable').ColdObservable;
+ public createColdObservable(
+ ...args: Array
+ ): import('rxjs/dist/types/internal/testing/ColdObservable').ColdObservable {
const [marbleValue, value, error] = args;
if (typeof marbleValue === 'string' && marbleValue.indexOf(SubscriptionMarbleToken.SUBSCRIBE) !== -1) {
@@ -86,21 +105,29 @@ class TestScheduler extends VirtualTimeScheduler {
const messages = Array.isArray(marbleValue)
? marbleValue
- : parseObservableMarble(marbleValue, value, error, false, this.frameTimeFactor, this._maxFrame) as any;
- const observable = new ColdObservable(messages as Array>>>, this);
+ : (parseObservableMarble(marbleValue, value, error, false, this.frameTimeFactor, this._maxFrame) as any);
+ const observable = new coldObservableCtor(messages as Array>>>, this);
this.coldObservables.push(observable);
return observable;
}
- public createHotObservable(marble: string, value?: { [key: string]: T } | null, error?: any): HotObservable;
- public createHotObservable(message: Array>): HotObservable;
- public createHotObservable(...args: Array): HotObservable {
+ public createHotObservable(
+ marble: string,
+ value?: { [key: string]: T } | null,
+ error?: any
+ ): import('rxjs/dist/types/internal/testing/HotObservable').HotObservable;
+ public createHotObservable(
+ message: Array>
+ ): import('rxjs/dist/types/internal/testing/HotObservable').HotObservable;
+ public createHotObservable(
+ ...args: Array
+ ): import('rxjs/dist/types/internal/testing/HotObservable').HotObservable {
const [marbleValue, value, error] = args;
const messages = Array.isArray(marbleValue)
? marbleValue
- : parseObservableMarble(marbleValue, value, error, false, this.frameTimeFactor, this._maxFrame) as any;
- const subject = new HotObservable(messages as Array>>>, this);
+ : (parseObservableMarble(marbleValue, value, error, false, this.frameTimeFactor, this._maxFrame) as any);
+ const subject = new hotObservableCtor(messages as Array>>>, this);
this.hotObservables.push(subject);
return subject;
}
@@ -124,8 +151,8 @@ class TestScheduler extends VirtualTimeScheduler {
innerObservableMetadata.push(new TestMessageValue(this.frame - outerFrame, notification));
observable.subscribe(
- value => pushMetaData(Notification.createNext(value)),
- err => pushMetaData(Notification.createError(err)),
+ (value) => pushMetaData(Notification.createNext(value)),
+ (err) => pushMetaData(Notification.createError(err)),
() => pushMetaData(Notification.createComplete())
);
@@ -177,4 +204,4 @@ class TestScheduler extends VirtualTimeScheduler {
}
}
-export { TestScheduler };
+export { TestScheduler, VirtualTimeScheduler };
diff --git a/src/scheduler/calculateSubscriptionFrame.ts b/src/scheduler/calculateSubscriptionFrame.ts
index cfc2809..5bc5f7d 100644
--- a/src/scheduler/calculateSubscriptionFrame.ts
+++ b/src/scheduler/calculateSubscriptionFrame.ts
@@ -1,8 +1,11 @@
import { Observable } from 'rxjs';
-import { ColdObservable } from 'rxjs/internal/testing/ColdObservable';
-import { HotObservable } from 'rxjs/internal/testing/HotObservable';
import { parseSubscriptionMarble } from '../marbles/parseSubscriptionMarble';
+//tslint:disable no-var-requires no-require-imports
+const { ColdObservable } = require('rxjs/dist/cjs/internal/testing/ColdObservable');
+const { HotObservable } = require('rxjs/dist/cjs/internal/testing/HotObservable');
+//tslint:enable no-var-requires no-require-imports
+
const calculateSubscriptionFrame = (
observable: Observable,
unsubscriptionMarbles: string | null,
@@ -25,7 +28,7 @@ const calculateSubscriptionFrame = (
return {
subscribedFrame: 0,
unsubscribedFrame:
- unsubscribedFrame === Number.POSITIVE_INFINITY ? unsubscribedFrame : unsubscribedFrame - subscribedFrame
+ unsubscribedFrame === Number.POSITIVE_INFINITY ? unsubscribedFrame : unsubscribedFrame - subscribedFrame,
};
}
source = (source as any).source;