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

test: fix storybook's __test is not defined errors #228

Merged
merged 1 commit into from
Aug 12, 2024
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,10 @@
"singleQuote": true,
"tabWidth": 4,
"printWidth": 80
},
"pnpm": {
"patchedDependencies": {
"@storybook/test-runner": "patches/@storybook__test-runner.patch"
}
}
}
52 changes: 52 additions & 0 deletions patches/@storybook__test-runner.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
diff --git a/dist/index.js b/dist/index.js
index accc3632466e5b25b0122b2961e7c94a80a2759b..1984513ac34861abe5d800cbfa2dd7ddad770bef 100644
--- a/dist/index.js
+++ b/dist/index.js
@@ -13566,7 +13566,7 @@ var testPrefixer = /* @__PURE__ */ __name((context) => {
await globalThis.__sbPreVisit(page, context);
}

- const result = await page.evaluate(({ id, hasPlayFn }) => __test(id, hasPlayFn), {
+ const result = await page.addInitScript(({ id, hasPlayFn }) => __test(id, hasPlayFn), {
id: %%id%%,
});

diff --git a/dist/index.mjs b/dist/index.mjs
index 3bef97836744b3c38d5cf7cbf1a7da806ea1b850..d3fc1cfdecad3eed12566bdfb8b51d4da4a339dc 100644
--- a/dist/index.mjs
+++ b/dist/index.mjs
@@ -13549,7 +13549,7 @@ var testPrefixer = /* @__PURE__ */ __name((context) => {
await globalThis.__sbPreVisit(page, context);
}

- const result = await page.evaluate(({ id, hasPlayFn }) => __test(id, hasPlayFn), {
+ const result = await page.addInitScript(({ id, hasPlayFn }) => __test(id, hasPlayFn), {
id: %%id%%,
});

diff --git a/dist/test-storybook.js b/dist/test-storybook.js
index f5f2a8f08d189c87316d69aabe906d2ef320e02d..c36a2d6bfc398dc593d56feb2f4290f6f5e21aa3 100755
--- a/dist/test-storybook.js
+++ b/dist/test-storybook.js
@@ -17623,7 +17623,7 @@ var testPrefixer = /* @__PURE__ */ __name((context) => {
await globalThis.__sbPreVisit(page, context);
}

- const result = await page.evaluate(({ id, hasPlayFn }) => __test(id, hasPlayFn), {
+ const result = await page.addInitScript(({ id, hasPlayFn }) => __test(id, hasPlayFn), {
id: %%id%%,
});

diff --git a/dist/test-storybook.mjs b/dist/test-storybook.mjs
index 2ac7d7a93f6582ea736dff80709646ede0def3fd..14f3dc1cb9b69a203604609075c82acaf1206874 100755
--- a/dist/test-storybook.mjs
+++ b/dist/test-storybook.mjs
@@ -17629,7 +17629,7 @@ var testPrefixer = /* @__PURE__ */ __name((context) => {
await globalThis.__sbPreVisit(page, context);
}

- const result = await page.evaluate(({ id, hasPlayFn }) => __test(id, hasPlayFn), {
+ const result = await page.addInitScript(({ id, hasPlayFn }) => __test(id, hasPlayFn), {
id: %%id%%,
});

9 changes: 7 additions & 2 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading