Coverage.startJSCoverage() 方法
🌐 Coverage.startJSCoverage() method
语法
🌐 Signature
class Coverage {
startJSCoverage(options?: JSCoverageOptions): Promise<void>;
}
参数
🌐 Parameters
范围 🌐 Parameter | 类型 🌐 Type | 描述 🌐 Description |
|---|---|---|
options | (可选) 覆盖默认值的可配置选项集,默认为 🌐 (Optional) Set of configurable options for coverage defaults to |
返回:
Promise<void>
Promise 在覆盖范围开始时解决。
🌐 Promise that resolves when coverage is started.
附注
🌐 Remarks
匿名脚本是没有关联 URL 的脚本。这些脚本是在页面上使用 eval 或 new Function 动态创建的。如果 reportAnonymousScripts 被设置为 true,匿名脚本的 URL 将以 debugger://VM 开头(除非存在一个魔法 //# sourceURL 注释,在这种情况下,该注释将作为 URL)。
🌐 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 URL will start with debugger://VM (unless a magic //# sourceURL comment is present, in which case that will the be URL).