Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: added comments for browsercontext, startCSSCoverage, and startJSCoverage. #7264

Merged
merged 2 commits into from May 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/common/Browser.ts
Expand Up @@ -417,7 +417,8 @@ export class Browser extends EventEmitter {
}

/**
* Creates a {@link Page} in the default browser context.
* Promise which resolves to a new {@link Page} object. The Page is created in
* a default browser context.
*/
async newPage(): Promise<Page> {
return this._defaultContext.newPage();
Expand Down
7 changes: 4 additions & 3 deletions src/common/Coverage.ts
Expand Up @@ -123,8 +123,8 @@ export class Coverage {
}

/**
* @param options - defaults to
* `{ resetOnNavigation : true, reportAnonymousScripts : false }`
* @param options - Set of configurable options for coverage defaults to `{
* resetOnNavigation : true, reportAnonymousScripts : false }`
* @returns Promise that resolves when coverage is started.
*
* @remarks
Expand All @@ -150,7 +150,8 @@ export class Coverage {
}

/**
* @param options - defaults to `{ resetOnNavigation : true }`
* @param options - Set of configurable options for coverage, defaults to `{
* resetOnNavigation : true }`
* @returns Promise that resolves when coverage is started.
*/
async startCSSCoverage(options: CSSCoverageOptions = {}): Promise<void> {
Expand Down
8 changes: 4 additions & 4 deletions src/common/EventEmitter.ts
Expand Up @@ -55,7 +55,7 @@ export class EventEmitter implements CommonEventEmitter {
* Bind an event listener to fire when an event occurs.
* @param event - the event type you'd like to listen to. Can be a string or symbol.
* @param handler - the function to be called when the event occurs.
* @returns `this` to enable you to chain calls.
* @returns `this` to enable you to chain method calls.
*/
on(event: EventType, handler: Handler): EventEmitter {
this.emitter.on(event, handler);
Expand All @@ -66,7 +66,7 @@ export class EventEmitter implements CommonEventEmitter {
* Remove an event listener from firing.
* @param event - the event type you'd like to stop listening to.
* @param handler - the function that should be removed.
* @returns `this` to enable you to chain calls.
* @returns `this` to enable you to chain method calls.
*/
off(event: EventType, handler: Handler): EventEmitter {
this.emitter.off(event, handler);
Expand Down Expand Up @@ -107,7 +107,7 @@ export class EventEmitter implements CommonEventEmitter {
* Like `on` but the listener will only be fired once and then it will be removed.
* @param event - the event you'd like to listen to
* @param handler - the handler function to run when the event occurs
* @returns `this` to enable you to chain calls.
* @returns `this` to enable you to chain method calls.
*/
once(event: EventType, handler: Handler): EventEmitter {
const onceHandler: Handler = (eventData) => {
Expand All @@ -132,7 +132,7 @@ export class EventEmitter implements CommonEventEmitter {
* Removes all listeners. If given an event argument, it will remove only
* listeners for that event.
* @param event - the event to remove listeners for.
* @returns `this` to enable you to chain calls.
* @returns `this` to enable you to chain method calls.
*/
removeAllListeners(event?: EventType): EventEmitter {
if (event) {
Expand Down
3 changes: 3 additions & 0 deletions src/common/Target.ts
Expand Up @@ -191,6 +191,9 @@ export class Target {
return this._browserContext.browser();
}

/**
* Get the browser context the target belongs to.
*/
browserContext(): BrowserContext {
return this._browserContext;
}
Expand Down
6 changes: 4 additions & 2 deletions src/node/BrowserFetcher.ts
Expand Up @@ -220,14 +220,16 @@ export class BrowserFetcher {
}

/**
* @returns Returns the current `Platform`.
* @returns Returns the current `Platform`, which is one of `mac`, `linux`,
* `win32` or `win64`.
*/
platform(): Platform {
return this._platform;
}

/**
* @returns Returns the current `Product`.
* @returns Returns the current `Product`, which is one of `chrome` or
* `firefox`.
*/
product(): Product {
return this._product;
Expand Down
5 changes: 3 additions & 2 deletions tsconfig.json
Expand Up @@ -7,8 +7,9 @@
"extends": "./tsconfig.base.json",
"compilerOptions": {
"noEmit": true,
// This module setting is just for VSCode so it doesn't error when we use
// dynamic imports.
/* This module setting is just for VSCode so it doesn't throw error when we
use dynamic imports.
*/
"module": "esnext"
},
"include": ["src"]
Expand Down