Package com.google.javascript.jscomp
Class ExportTestFunctions
- java.lang.Object
-
- com.google.javascript.jscomp.ExportTestFunctions
-
- All Implemented Interfaces:
CompilerPass
public class ExportTestFunctions extends java.lang.Object implements CompilerPass
Generates goog.exportSymbol for test functions, so they can be recognized by the test runner, even if the code is compiled.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static boolean
isTestFunction(java.lang.String functionName)
Whether a function is recognized as a test function.void
process(Node externs, Node root)
Process the JS with root node root.
-
-
-
Method Detail
-
process
public void process(Node externs, Node root)
Description copied from interface:CompilerPass
Process the JS with root node root. Can modify the contents of each Node tree- Specified by:
process
in interfaceCompilerPass
- Parameters:
externs
- Top of external JS treeroot
- Top of JS tree
-
isTestFunction
public static boolean isTestFunction(java.lang.String functionName)
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:
true
if the function is recognized as a test function.
-
-