-
-
Notifications
You must be signed in to change notification settings - Fork 12
test: more test cases #63
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
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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
This PR adds end-to-end and CLI tests, refactors test project scaffolding, and enhances CLI behavior and workspace setup.
- Introduces E2E Vitest configuration and a Cal.com schema generation test.
- Extracts
createTestProjectinto@zenstackhq/testtoolsand updatesgenerateTsSchemato use it. - Extends the CLI with
--silentand--save-prisma-schemaoptions, improves migrate/db actions to clean up temp schemas, and adds extensive CLI tests.
Reviewed Changes
Copilot reviewed 21 out of 22 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/e2e/vitest.config.ts | Add Vitest config merging base config for E2E tests. |
| tests/e2e/package.json | Initialize E2E test project with test script and workspace dependency. |
| tests/e2e/cal.com/schema.zmodel | Bulk import of Cal.com Prisma-Z schema for tests. |
| tests/e2e/cal.com/cal-com.test.ts | Add a basic E2E test for schema generation. |
| samples/blog/package.json | Update Prisma dependency to use catalog registry. |
| pnpm-workspace.yaml | Include tests/** in the workspace packages. |
| packages/testtools/src/project.ts | Extract createTestProject for scaffolding temp projects. |
| packages/testtools/src/schema.ts | Refactor generateTsSchema to rely on createTestProject. |
| packages/testtools/src/index.ts | Export project and schema utilities. |
| packages/cli/test/utils.ts | Add helper to scaffold CLI test projects. |
| packages/cli/test/migrate.test.ts | Add tests for cli migrate commands. |
| packages/cli/test/init.test.ts | Add test for cli init command. |
| packages/cli/test/generate.test.ts | Add tests for cli generate command. |
| packages/cli/test/db.test.ts | Add test for cli db push command. |
| packages/cli/src/index.ts | Register new CLI options --silent and --save-prisma-schema. |
| packages/cli/src/actions/migrate.ts | Refactor migrate actions to generate and clean up a temp Prisma schema. |
| packages/cli/src/actions/generate.ts | Support saving a Prisma schema file via --save-prisma-schema. |
| packages/cli/src/actions/db.ts | Refactor db push to use a temp schema and support additional flags. |
| packages/cli/src/actions/action-utils.ts | Add generateTempPrismaSchema utility. |
| packages/cli/package.json | Update CLI dependencies and add missing devDependencies. |
| .github/workflows/publish-release.yml | Remove prerelease: true flag from the GitHub release workflow. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (1)
tests/e2e/cal.com/cal-com.test.ts:13
- This test does not assert any behavior; consider adding an assertion to verify that the generated schema is defined or meets expected criteria (e.g., expect(generated.schema).toBeDefined()).
console.log(generated);
No description provided.