Search in sources :

Example 1 with StrictWarningsGuard

use of com.google.javascript.jscomp.StrictWarningsGuard in project closure-compiler by google.

the class IntegrationTest method testStrictWarningsGuard.

@Test
public void testStrictWarningsGuard() {
    CompilerOptions options = createCompilerOptions();
    options.setCheckTypes(true);
    options.addWarningsGuard(new StrictWarningsGuard());
    Compiler compiler = compile(options, "/** @return {number} */ function f() { return true; }");
    assertThat(compiler.getErrors()).hasSize(1);
    assertThat(compiler.getWarnings()).isEmpty();
}
Also used : Compiler(com.google.javascript.jscomp.Compiler) CompilerOptions(com.google.javascript.jscomp.CompilerOptions) StrictWarningsGuard(com.google.javascript.jscomp.StrictWarningsGuard) Test(org.junit.Test)

Aggregations

Compiler (com.google.javascript.jscomp.Compiler)1 CompilerOptions (com.google.javascript.jscomp.CompilerOptions)1 StrictWarningsGuard (com.google.javascript.jscomp.StrictWarningsGuard)1 Test (org.junit.Test)1