Skip to content

Commit

Permalink
Await exposeFunction (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamie5 committed Oct 4, 2022
1 parent 20c5e69 commit eeb3301
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/storycap/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@remix/storycap",
"version": "1.0.3",
"version": "1.0.4",
"description": "A Storybook addon, Save the screenshot image of your stories! via puppeteer.",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
Expand Down
4 changes: 3 additions & 1 deletion packages/storycap/src/node/capturing-browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ export class CapturingBrowser extends StoryPreviewBrowser {
waitBrowserMetricsStable: () => this.waitBrowserMetricsStable('preEmit'),
setViewport: (viewport: Viewport) => this.page.setViewport(viewport),
};
Object.entries(exposed).forEach(([k, f]) => this.page.exposeFunction(k, f));
for (const [k, f] of Object.entries(exposed)) {
await this.page.exposeFunction(k, f);
}
}

private async reload() {
Expand Down

0 comments on commit eeb3301

Please sign in to comment.