Skip to content

Commit 7ef98d7

Browse files
authored
Merge pull request #22 from kwonoj/chore-lint
style(testscheduler): update code lint, hint friendly
2 parents f139bd5 + eb6be84 commit 7ef98d7

File tree

3 files changed

+21
-15
lines changed

3 files changed

+21
-15
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"prepush": "npm-run-all build test",
2626
"commitmsg": "commitlint -e",
2727
"test": "jest --config jest.json --coverage",
28-
"lint": "tslint \"src/**/*.ts\" \"spec/**/*.ts\"",
28+
"lint": "tslint --type-check -c tslint.json -p tsconfig.json \"src/**/*.ts\" \"spec/**/*.ts\"",
2929
"lint:staged": "lint-staged",
3030
"build": "npm-run-all build:clean && tsc",
3131
"build:clean": "shx rm -rf ./dist",

src/scheduler/TestScheduler.ts

+14-14
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,6 @@ class TestScheduler extends VirtualTimeScheduler {
1919
super(VirtualAction, Number.POSITIVE_INFINITY);
2020
}
2121

22-
private materializeInnerObservable<T>(observable: Observable<any>, outerFrame: number): Array<TestMessage<T>> {
23-
const innerObservableMetadata: Array<TestMessage<T>> = [];
24-
const pushMetaData = (notification: Notification<T>) =>
25-
innerObservableMetadata.push(new TestMessageValue<T>(this.frame - outerFrame, notification));
26-
27-
observable.subscribe(
28-
value => pushMetaData(Notification.createNext(value)),
29-
err => pushMetaData(Notification.createError(err)),
30-
() => pushMetaData(Notification.createComplete())
31-
);
32-
33-
return innerObservableMetadata;
34-
}
35-
3622
public getMarbles<T = string>(observable: Observable<T>, unsubscriptionMarbles: string | null = null) {
3723
if (this.autoFlush) {
3824
throw new Error('not implemented');
@@ -102,6 +88,20 @@ class TestScheduler extends VirtualTimeScheduler {
10288
this.hotObservables.push(subject);
10389
return subject;
10490
}
91+
92+
private materializeInnerObservable<T>(observable: Observable<any>, outerFrame: number): Array<TestMessage<T>> {
93+
const innerObservableMetadata: Array<TestMessage<T>> = [];
94+
const pushMetaData = (notification: Notification<T>) =>
95+
innerObservableMetadata.push(new TestMessageValue<T>(this.frame - outerFrame, notification));
96+
97+
observable.subscribe(
98+
value => pushMetaData(Notification.createNext(value)),
99+
err => pushMetaData(Notification.createError(err)),
100+
() => pushMetaData(Notification.createComplete())
101+
);
102+
103+
return innerObservableMetadata;
104+
}
105105
}
106106

107107
export { TestScheduler };

tslint.json

+6
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@
1111
true,
1212
"spaces"
1313
],
14+
"member-ordering": [
15+
true,
16+
{
17+
"order": "fields-first"
18+
}
19+
],
1420
"max-line-length": [
1521
true,
1622
150

0 commit comments

Comments
 (0)