visibleForTesting top-level constant
Used to annotate a declaration that was made public, so that it is more visible than otherwise necessary, to make code testable.
Tools, such as the analyzer, can provide feedback if
- the annotation is associated with a declaration not in the
libfolder of a package, or a private declaration, or a declaration in an unnamed static extension, or
- the declaration is referenced outside of its defining library or a
library which is in the
testfolder of the defining package.
const _VisibleForTesting visibleForTesting = _VisibleForTesting();