Skip to content

Commit

Permalink
fix: await closing
Browse files Browse the repository at this point in the history
  • Loading branch information
lowlighter authored Oct 12, 2023
1 parent e10f729 commit c42af6d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export class Browser {
* Closes the browser and all of its pages (if any were opened). The Browser object itself is considered to be disposed and cannot be used anymore.
*/
async close() {
this.#celestial.close();
await this.#celestial.close();
this.#process.kill();
await this.#process.status;
}
Expand Down
2 changes: 1 addition & 1 deletion src/page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ export class Page extends EventTarget {
return;
}

this.#celestial.close();
await this.#celestial.close();

throw new Error(`Page has already been closed or doesn't exist (${res})`);
}
Expand Down

0 comments on commit c42af6d

Please sign in to comment.