Skip to content

Conversation

35C4n0r
Copy link
Contributor

@35C4n0r 35C4n0r commented May 19, 2025

Pull Request

Description

Use any combination from the given comand:
npx tsx ./source/cli.tsx test generate e2e --models=ABAC --models=RBAC --path=zz.json --dry-run --snippet=jest --snippet-path=a.test.js

Combinations used in demo

CLI Command Combinations for Test Generation

1. Original command - Generate E2E tests for both ABAC and RBAC models with Jest snippets (dry run)

npx tsx ./source/cli.tsx test generate e2e --models=ABAC --models=RBAC --path=zz.json --dry-run --snippet=jest --snippet-path=a.test.js

2. ABAC model only - Generate E2E tests for ABAC model with Jest snippets (dry run)

npx tsx ./source/cli.tsx test generate e2e --models=ABAC --path=abac-tests.json --dry-run --snippet=jest --snippet-path=abac.test.js

3. RBAC model only - Generate E2E tests for RBAC model with Jest snippets (dry run)

npx tsx ./source/cli.tsx test generate e2e --models=RBAC --path=rbac-tests.json --dry-run --snippet=jest --snippet-path=rbac.test.js

4. No snippets - Generate only the test configuration without code snippets

npx tsx ./source/cli.tsx test generate e2e --models=ABAC --models=RBAC --path=config-only.json --dry-run

5. Minimal command - Basic test generation without optional parameters

npx tsx ./source/cli.tsx test generate e2e --models=RBAC --models=ABAC

Demo was done on this configuration
image

https://www.loom.com/share/af278739f61f47aba2e66ecd95180359

Type of Change

  • Bug fix
  • New feature/command
  • Documentation update
  • Code refactoring
  • Performance improvement
  • Test addition/update
  • Other (please describe):

Checklist

  • I have created an issue and linked it in this PR
  • I have created a branch from main with an appropriate name (e.g., fix/issue-123, feature/new-command)
  • My code follows the project's coding style guidelines
  • I have added tests for my changes (>90% coverage of new code)
  • I have updated the documentation if necessary
  • All tests pass locally
  • Lint checks pass locally
  • I have reviewed my own code for potential issues

New Command Details (if applicable)

  • Command is placed in the src/commands directory
  • Command file contains only argument configuration and a root command component
  • Command is wrapped with the AuthProvider component
  • Command has an optional apiKey argument
  • API key scope is declared for the command
  • Documentation added to the README

Additional Notes

Screenshots/Recordings

Copy link
Collaborator

@gemanor gemanor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Please attach a loom/screencast of the feature with some edge cases

const name = 'test-tenant-' + randomName('', '');
refTenantId.current = name;
if (dryRun) {
// eslint-disable-next-line sonarjs/no-duplicate-string
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we fix this?

@35C4n0r 35C4n0r requested a review from gemanor June 15, 2025 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants