UNPKG

1.04 kBJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3const Lint = require("tslint");
4const GeneralRuleUtils_1 = require("./utils/GeneralRuleUtils");
5const RULE_ID = "tsf-folders-test-with-breakpoint";
6class 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}
16exports.Rule = Rule;
17class 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//# sourceMappingURL=tsfFoldersTestWithBreakpointRule.js.map
\No newline at end of file