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 boolean
isTestFunction
(String functionName) Whether a function is recognized as a test function.void
Process the JS with root node root.
-
Method Details
-
process
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
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.
-