From 7ed329276abc51553e58d02c99e71a3d2a06a341 Mon Sep 17 00:00:00 2001 From: Yang Guo Date: Fri, 26 Jun 2020 12:31:47 +0200 Subject: [PATCH] Fix lint --- src/common/Coverage.ts | 40 +++++++++++++------------ utils/doclint/check_public_api/index.js | 14 +++++++++ 2 files changed, 35 insertions(+), 19 deletions(-) diff --git a/src/common/Coverage.ts b/src/common/Coverage.ts index f327a171e5116..5b590a0a2be8d 100644 --- a/src/common/Coverage.ts +++ b/src/common/Coverage.ts @@ -24,7 +24,7 @@ import { EVALUATION_SCRIPT_URL } from './ExecutionContext'; /** * The CoverageEntry class represents one entry of the coverage report. * @public -*/ + */ export interface CoverageEntry { /** * The URL of the style sheet or script. @@ -69,11 +69,11 @@ export interface CSSCoverageOptions { /** * The Coverage class provides methods to gathers information about parts of * JavaScript and CSS that were used by the page. - * + * * @remarks * To output coverage in a form consumable by {@link https://github.com/istanbuljs | Istanbul}, * see {@link https://github.com/istanbuljs/puppeteer-to-istanbul | puppeteer-to-istanbul}. - * + * * @example * An example of using JavaScript and CSS coverage to get percentage of initially * executed code: @@ -118,25 +118,27 @@ export class Coverage { } /** - * @param options - defaults to `{ resetOnNavigation : true, reportAnonymousScripts : false }` + * @param options - defaults to + * `{ resetOnNavigation : true, reportAnonymousScripts : false }` * @returns Promise that resolves when coverage is started. - * + * * @remarks - * 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. + * 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. */ - async startJSCoverage( - options: JSCoverageOptions = {} - ): Promise { + async startJSCoverage(options: JSCoverageOptions = {}): Promise { return await this._jsCoverage.start(options); } /** - * @returns Promise that resolves to the array of coverage reports for all scripts. - * + * @returns Promise that resolves to the array of coverage reports for + * all scripts. + * * @remarks - * JavaScript Coverage doesn't include anonymous scripts by default. However, scripts with sourceURLs are reported. + * JavaScript Coverage doesn't include anonymous scripts by default. + * However, scripts with sourceURLs are reported. */ async stopJSCoverage(): Promise { return await this._jsCoverage.stop(); @@ -146,16 +148,16 @@ export class Coverage { * @param options - defaults to `{ resetOnNavigation : true }` * @returns Promise that resolves when coverage is started. */ - async startCSSCoverage( - options: CSSCoverageOptions = {} - ): Promise { + async startCSSCoverage(options: CSSCoverageOptions = {}): Promise { return await this._cssCoverage.start(options); } /** - * @returns Promise that resolves to the array of coverage reports for all stylesheets. + * @returns Promise that resolves to the array of coverage reports + * for all stylesheets. * @remarks - * CSS Coverage doesn't include dynamically injected style tags without sourceURLs. + * CSS Coverage doesn't include dynamically injected style tags + * without sourceURLs. */ async stopCSSCoverage(): Promise { return await this._cssCoverage.stop(); diff --git a/utils/doclint/check_public_api/index.js b/utils/doclint/check_public_api/index.js index b41c27852d0dc..45021b1993bb1 100644 --- a/utils/doclint/check_public_api/index.js +++ b/utils/doclint/check_public_api/index.js @@ -710,6 +710,20 @@ function compareDocumentations(actual, expected) { expectedName: 'Object', }, ], + [ + 'Method Coverage.startCSSCoverage() options', + { + actualName: 'Object', + expectedName: 'CSSCoverageOptions', + }, + ], + [ + 'Method Coverage.startJSCoverage() options', + { + actualName: 'Object', + expectedName: 'JSCoverageOptions', + }, + ], ]); const expectedForSource = expectedNamingMismatches.get(source);