-
-
Notifications
You must be signed in to change notification settings - Fork 251
test(e2e): remove redundant cwd declarations #6311
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
✅ Deploy Preview for rsbuild ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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.
Pull Request Overview
Removes redundant cwd usage in E2E tests to rely on the test context, and switches entry paths to relative strings for simplicity.
- Drop hardcoded cwd declarations and stop passing cwd into build/buildPreview
- Update entries from join(cwd, 'src/...') to './src/...'
- Destructure cwd from test context only where file operations require it
Reviewed Changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
e2e/cases/server/public-dir/publicDir.test.ts | Remove local cwd and stop passing it to build/buildPreview; keep path operations using __dirname. |
e2e/cases/server/public-dir-with-template/index.test.ts | Remove cwd and call buildPreview without cwd. |
e2e/cases/server/public-dir-with-multi-template/index.test.ts | Remove cwd and call buildPreview without cwd. |
e2e/cases/server/print-urls/index.test.ts | Remove cwd and call buildPreview without cwd. |
e2e/cases/server/html-fallback/index.test.ts | Replace join(cwd, ...) entries with './src/index.js' across tests. |
e2e/cases/server/history-api-fallback/historyApiFallback.test.ts | Remove cwd/join usage and use './src/index.jsx'; stop passing cwd to buildPreview. |
e2e/cases/print-file-size/with-error/index.test.ts | Remove cwd and build without it. |
e2e/cases/print-file-size/basic/index.test.ts | Remove cwd and build without it; keep helper using toPosixPath. |
e2e/cases/plugin-react/disable-fast-refresh/index.test.ts | Destructure cwd from test context for fs operations; remove local cwd. |
e2e/cases/output/clean-dist-path/index.test.ts | Build without passing cwd; retain existing cwd for path setup. |
e2e/cases/hmr/reconnect/index.test.ts | Destructure cwd from test context and remove local cwd. |
e2e/cases/hmr/rebuild-logs/index.test.ts | Destructure cwd in both tests; remove local cwd. |
e2e/cases/hmr/multiple-connection/index.test.ts | Destructure cwd and remove local cwd. |
e2e/cases/hmr/error-recovery/index.test.ts | Destructure cwd and remove local cwd. |
e2e/cases/hmr/client-port-placeholder/index.test.ts | Destructure cwd and remove local cwd. |
e2e/cases/hmr/client-host/index.test.ts | Destructure cwd and remove local cwd. |
e2e/cases/hmr/basic/index.test.ts | Convert to rspackTest(...) form and destructure cwd; remove local cwd. |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
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.
💡 Codex Review
rsbuild/e2e/cases/server/html-fallback/index.test.ts
Lines 1 to 4 in 9808dca
import { join } from 'node:path'; | |
import { expect, getFileContent, test } from '@e2e/helper'; | |
const cwd = __dirname; |
After switching the test to use relative entry paths, the join
import and const cwd = __dirname
declaration at the top of this file are no longer referenced anywhere. The repository’s lint rules (per AGENTS instructions) treat unused imports/variables as errors, so pnpm lint
and CI will now fail. Consider removing these declarations to keep the test lint‑clean.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting
Summary
cwd
provided by test contextjoin
Checklist