test/com/google/javascript/jscomp/RhinoErrorReporterTest.java
/**
   * Verifies that the compiler emits an error for the given code.
   */
Verifies that the compiler emits an error for the given code.
Verifies that the compiler emits an error for the given code .
private JSError assertError(
      String code, DiagnosticType type, String description) {
    Compiler compiler = parseCode(code);
    assertWithMessage("Expected error").that(compiler.getErrorCount()).isEqualTo(1);
    JSError error =
        Iterables.getOnlyElement(Arrays.asList(compiler.getErrors()));
    assertThat(error.getType()).isEqualTo(type);
    assertThat(error.description).isEqualTo(description);
    return error;
  }
private JSError assertError ( String code , DiagnosticType type , String description ) { Compiler compiler = parseCode ( code ) ; assertWithMessage ( "Expected error" ) . that ( compiler . getErrorCount ( ) ) . isEqualTo ( 1 ) ; JSError error = Iterables . getOnlyElement ( Arrays . asList ( compiler . getErrors ( ) ) ) ; assertThat ( error . getType ( ) ) . isEqualTo ( type ) ; assertThat ( error . description ) . isEqualTo ( description ) ; return error ; }
Verifies that the compiler emits an error for the given code.
Verifies that the compiler emits an error for the given code .