startJSCoverage method

Future<void> startJSCoverage({
  1. bool? resetOnNavigation,
  2. bool? reportAnonymousScripts,
})

Parameters:

  • resetOnNavigation Whether to reset coverage on every navigation. Defaults to true.
  • reportAnonymousScripts: Whether anonymous scripts generated by the page should be reported. Defaults to false.

Returns a Future that resolves when coverage is started

NOTE Anonymous scripts are ones that don't have an associated url. These are scripts that are dynamically created on the page using eval or new Function. If reportAnonymousScripts is set to true, anonymous scripts will have __puppeteer_evaluation_script__ as their URL.

Implementation

Future<void> startJSCoverage(
    {bool? resetOnNavigation, bool? reportAnonymousScripts}) {
  return _jsCoverage.start(
      resetOnNavigation: resetOnNavigation,
      reportAnonymousScripts: reportAnonymousScripts);
}