@Test public void test() { CommentRegularExpressionCheck check = new CommentRegularExpressionCheck(); check.setRegularExpression("(?i).*TODO.*"); check.setMessage("Avoid TODO"); JavaScriptCheckVerifier.issues( check, new File("src/test/resources/checks/commentRegularExpression.js")) .next() .atLine(2) .withMessage("Avoid TODO") .noMore(); check.setRegularExpression(""); JavaScriptCheckVerifier.issues( check, new File("src/test/resources/checks/commentRegularExpression.js")) .noMore(); try { check.setRegularExpression("[abc"); } catch (IllegalStateException e) { assertThat(e.getMessage()).isEqualTo("Unable to compile regular expression: [abc"); } }
@Test public void test() { NonEmptyCaseWithoutBreakCheck check = new NonEmptyCaseWithoutBreakCheck(); JavaScriptCheckVerifier.verify( check, new File("src/test/resources/checks/nonEmptyCaseWithoutBreak.js")); }