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(create-robo): validate new project creation #163

Open
15 tasks
Pkmmte opened this issue Dec 18, 2023 — with Volta.net · 0 comments
Open
15 tasks

test(create-robo): validate new project creation #163

Pkmmte opened this issue Dec 18, 2023 — with Volta.net · 0 comments
Assignees
Labels

Comments

Copy link
Member

Pkmmte commented Dec 18, 2023

Create tests that auto generate and clean up new projects and validates them to verify that files were generated correctly.

Because of our CLI's interactive nature, you will need to use mock-stdin to simulate input programatically when required such as during discord token input. Feel free to use shortcut options to avoid make things easier, such as --typescript or --javascript to skip the first step.

Preparation

You will need to generate various Robo projects for this. Unlike the API tests where the servers were created and started prior to the tests, these should be created during the test itself. That means that each test will create a new robo project for the things being tested specifically.

Once all tests are done running, you will need to delete the projects generated. It may also help to clean before the entire suite runs. I propose using packages/create-robo/__tests__/projects as the directory to generate these in.

Tests

Verify all of the generated files with each of the below tests, such as default example files, configuration, generated features, credentials (.env), .gitignore, etc.

Use npx for all of these tests, except for those under the Package Managers section.

Common

  • Plain Javascript: JavaScript, zero features, and credentials.
  • Plain TypeScript: TypeScript, zero features, and credentials.
  • Standard JavaScript: JavaScript, recommended features, and credentials.
  • Standard TypeScript: TypeScript, recommended features, and credentials.
  • Skipped Credentials JS: JavaScript, recommended features, and skip credentials.
  • Skipped Credentials TS: TypeScript, recommended features, and skip credentials.
  • Standard JS Plugin: Same as Standard JS but as a plugin.
  • Standard TS Plugin: Same as Standard TS but as a plugin.

Package Managers

  • PNPM: Same as Standard TS but started via pnpx.
  • Yarn: Same as Standard TS but started via yarn create.
  • Bun: Same as Standard TS but started via bunx.

Special

  • Plugins: Same as Standard TS but with the api and ai plugins installed.
  • Custom Template: Create new project from this repo's typescript template. (-t)
  • Robo Version: Same as Standard TS but using a specific version of Robo.js.
  • No Install: Same as Standard TS minus the installation of dependencies. (-ni)

Remember to test the creation of combo-specific files for some of these tests. For example, the standard tests should validate Prettier and ESLint files. Similarly, other tests like Plugins should validate the difference in documentation generated alongside the correct config.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants