Skip to content

Commit

Permalink
chore(test): Add expectations.
Browse files Browse the repository at this point in the history
By default, calling methods via `this` should not effect failures.
  • Loading branch information
cartant committed Jul 19, 2018
1 parent 18abb3c commit 6d3aa9c
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/v5/fixtures/no-unsafe-scope/default/fixture.ts.lint
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ class User {
~~~~ [no-unsafe-scope]
of("Hello").pipe(map(value => `${value}, ${this.name}.`)).subscribe();
~~~~ [no-unsafe-scope]
Observable.of("Hello").map(value => `${value}, ${this.foo()}.`).subscribe();
of("Hello").pipe(map(value => `${value}, ${this.foo()}.`)).subscribe();
}
foo(): string { return "foo"; }
}

[no-unsafe-scope]: Unsafe scopes are forbidden
7 changes: 7 additions & 0 deletions test/v5/fixtures/no-unsafe-takewhile/default/fixture.ts.lint
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,13 @@ class Something {
takeWhile(() => this._alive)
~~~~ [no-unsafe-takewhile]
).subscribe();

_source.pipe(
takeWhile(() => this.alive())
).subscribe();
}
alive(): boolean {
return this._alive;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ class User {
~~~~ [no-unsafe-scope]
of("Hello").pipe(map(value => `${value}, ${this.name}.`)).subscribe();
~~~~ [no-unsafe-scope]
Observable.of("Hello").map(value => `${value}, ${this.foo()}.`).subscribe();
of("Hello").pipe(map(value => `${value}, ${this.foo()}.`)).subscribe();
}
foo(): string { return "foo"; }
}

[no-unsafe-scope]: Unsafe scopes are forbidden
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,13 @@ class Something {
takeWhile(() => this._alive)
~~~~ [no-unsafe-takewhile]
).subscribe();

_source.pipe(
takeWhile(() => this.alive())
).subscribe();
}
alive(): boolean {
return this._alive;
}
}

Expand Down
2 changes: 2 additions & 0 deletions test/v6/fixtures/no-unsafe-scope/default/fixture.ts.lint
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ class User {
constructor(private name: string) {
of("Hello").pipe(map(value => `${value}, ${this.name}.`)).subscribe();
~~~~ [no-unsafe-scope]
of("Hello").pipe(map(value => `${value}, ${this.foo()}.`)).subscribe();
}
foo(): string { return "foo"; }
}

[no-unsafe-scope]: Unsafe scopes are forbidden
7 changes: 7 additions & 0 deletions test/v6/fixtures/no-unsafe-takewhile/default/fixture.ts.lint
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ class Something {
takeWhile(() => this._alive)
~~~~ [no-unsafe-takewhile]
).subscribe();

_source.pipe(
takeWhile(() => this.alive())
).subscribe();
}
alive(): boolean {
return this._alive;
}
}

Expand Down

0 comments on commit 6d3aa9c

Please sign in to comment.