1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | const Lint = require("tslint");
|
4 | const GeneralRuleUtils_1 = require("./utils/GeneralRuleUtils");
|
5 | const RULE_ID = "tsf-folders-test-with-breakpoint";
|
6 | class Rule extends Lint.Rules.AbstractRule {
|
7 | apply(sourceFile) {
|
8 | if (!GeneralRuleUtils_1.GeneralRuleUtils.isInTestFile(sourceFile.fileName)) {
|
9 | return [];
|
10 | }
|
11 | const walker = new StatementsWalker(sourceFile, this.getOptions());
|
12 | this.applyWithWalker(walker);
|
13 | return walker.getFailures();
|
14 | }
|
15 | }
|
16 | exports.Rule = Rule;
|
17 | class StatementsWalker extends Lint.RuleWalker {
|
18 | visitCallExpression(node) {
|
19 | const text = node.getText();
|
20 | if (text.startsWith("browser.debug")) {
|
21 | this.addFailureAtNode(node.getFirstToken(), GeneralRuleUtils_1.GeneralRuleUtils.buildFailureString("do not hard code breakpoints in the test", RULE_ID));
|
22 | }
|
23 | super.visitCallExpression(node);
|
24 | }
|
25 | }
|
26 |
|
\ | No newline at end of file |