Skip to content

Commit

Permalink
test(scope): Add failing test for #101.
Browse files Browse the repository at this point in the history
  • Loading branch information
cartant committed Jun 19, 2019
1 parent 17ff7fe commit 80873c5
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"test": "yarn run lint && yarn run test:build && yarn run test:mocha && yarn run test:tslint-v5 && yarn run test:tslint-v6 && yarn run test:tslint-v6-compat",
"test:build": "yarn run test:clean && tsc -p tsconfig.json",
"test:clean": "rimraf build",
"test:debug": "tslint --test \"./test/v6/fixtures/no-unsafe-scope/default/tslint.json\"",
"test:debug": "tslint --test \"./test/v6/fixtures/issues/101/tslint.json\"",
"test:issues": "yarn run test:clean && tsc -p tsconfig.json && tslint --test \"./test/v6/fixtures/issues/**/tslint.json\"",
"test:mocha": "mocha \"./build/**/*-spec.js\"",
"test:tslint-v5": "yarn --cwd ./test/v5 install && yarn --cwd ./test/v5 upgrade && tslint --test \"./test/v5/fixtures/**/tslint.json\"",
Expand Down
9 changes: 9 additions & 0 deletions test/v6/fixtures/issues/101/fixture.ts.lint
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { Observable, of } from "rxjs";
import { map } from "rxjs/operators";

of(1).pipe(map(value => {
console.log(value);
return value;
})).subscribe();

[no-unsafe-scope]: Unsafe scopes are forbidden
13 changes: 13 additions & 0 deletions test/v6/fixtures/issues/101/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"compilerOptions": {
"baseUrl": ".",
"lib": ["es2015", "dom"],
"noEmit": true,
"paths": {
"rxjs": ["../../node_modules/rxjs"]
},
"skipLibCheck": true,
"target": "es5"
},
"include": ["fixture.ts"]
}
8 changes: 8 additions & 0 deletions test/v6/fixtures/issues/101/tslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"defaultSeverity": "error",
"jsRules": {},
"rules": {
"rxjs-no-unsafe-scope": { "severity": "error" }
},
"rulesDirectory": "../../../../../build/rules"
}

0 comments on commit 80873c5

Please sign in to comment.