Package com.google.javascript.jscomp
Class ExportTestFunctions
java.lang.Object
com.google.javascript.jscomp.ExportTestFunctions
- All Implemented Interfaces:
CompilerPass
Generates goog.exportSymbol for test functions, so they can be recognized
by the test runner, even if the code is compiled.
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisTestFunction(String functionName) Whether a function is recognized as a test function.voidProcess the JS with root node root.
-
Method Details
-
process
Description copied from interface:CompilerPassProcess the JS with root node root. Can modify the contents of each Node tree- Specified by:
processin interfaceCompilerPass- Parameters:
externs- Top of external JS treeroot- Top of JS tree
-
isTestFunction
Whether a function is recognized as a test function. We follow the JsUnit convention for naming (functions should start with "test"), and we also check if it has no parameters declared.- Parameters:
functionName- The name of the function- Returns:
trueif the function is recognized as a test function.
-