-
Notifications
You must be signed in to change notification settings - Fork 16
test: enable testing with Wrangler for Pages and Workers #28
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
Conversation
|
Hey @ogadra ! Can you review this? |
| "typecheck": "tsc", | ||
| "preview": "npm run build && wrangler dev" | ||
| "preview": "npm run build && wrangler dev", | ||
| "test:e2e:workers": "npm run build && playwright test -c playwright-workers.config.ts e2e.test.ts" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be kinder to add examples/cloudflare-workers/playwright-vite.config.ts and this line ↓
"test:e2e:vite:workers": "playwright test -c playwright-vite.config.ts e2e.test.ts",There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I added the test for vite, it will test the same things as the test in examples/cloudflare-pages. So, I didn't add the test for examples/cloudflare-workers. But, as you feel, it looks weird why it does not test for Vite in examples/cloudflare-workers, and it is possible that the example will be changed. So, I'll add a vite test.
However, the naming of test is test:e2e:vite is okay since this name is used only in examples/cloudflare-workers project.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added the test for Vite: d92c8c2
| "typecheck": "tsc", | ||
| "preview": "npm run build && wrangler pages dev", | ||
| "test:e2e": "playwright test -- -c playwright.config.ts e2e.test.ts" | ||
| "test:e2e:vite": "playwright test -c playwright-vite.config.ts e2e.test.ts", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you add the test:e2e:vite:workers command, you might need to change this line.
| "test:e2e:vite": "playwright test -c playwright-vite.config.ts e2e.test.ts", | |
| "test:e2e:vite:pages": "playwright test -c playwright-vite.config.ts e2e.test.ts", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the same reason above, the change is unnecessary because this name is used only the project.
| "test:e2e": "npm run test:e2e:cloudflare-pages", | ||
| "test:e2e:cloudflare-pages": "npm run test:e2e -w example-cloudflare-pages", | ||
| "test:e2e": "npm-run-all -s test:e2e:*", | ||
| "test:e2e:vite": "npm run test:e2e:vite -w example-cloudflare-pages", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Anyway, I think it's okay to add the Vite test only in example-cloudflare-pages, not including example-cloudflare-workers's since the test can cover all tests for the Vite.
|
Thank you for the review. This seems to be good. Merging. |
Currently, the e2e test tests the app running on only Vite. This PR enables testing with the Wrangler command. This means we can test handlers for Cloudflare Workers and Cloudflare Pages.