Back to all reviewers

organize test scripts properly

remix-run/react-router
Based on 2 comments
Json

Keep base test scripts generic and create specialized variants for specific workflows. Base scripts like "test" should remain simple and flexible, allowing developers to pass additional arguments via CLI. For specialized workflows, create separate scripts with descriptive names.

Testing Json

Reviewer Prompt

Keep base test scripts generic and create specialized variants for specific workflows. Base scripts like “test” should remain simple and flexible, allowing developers to pass additional arguments via CLI. For specialized workflows, create separate scripts with descriptive names.

For example, instead of modifying the base test script:

{
  "scripts": {
    "test": "jest --projects packages/react-router --watch"
  }
}

Keep the base script generic and create specialized variants:

{
  "scripts": {
    "test": "jest",
    "test:integration": "pnpm build && pnpm test:integration:run",
    "test:integration:run": "pnpm playwright:integration"
  }
}

This approach allows developers to use npm test -- --projects packages/react-router --watch for custom CLI arguments while providing convenient shortcuts for common workflows. It also enables iterative testing without unnecessary rebuilds by separating build and execution steps.

2
Comments Analyzed
Json
Primary Language
Testing
Category

Source Discussions