Add Test
Scaffold a new .test.ts in the nearest tests/ folder so it runs with the test workflow.
Purpose
- Create a test quickly in the right location.
- Keep tests organized alongside the code under test.
When To Use
- Adding coverage for a feature, workflow, or contract.
CLI
webstir add-test <name-or-path> --workspace <path>- In this repo:
bun run webstir -- add-test <name-or-path> --workspace "$PWD/<workspace>"
Inputs
<name-or-path>: file name or relative path. The workflow resolves the closesttests/folder from the provided context.
Steps
- Resolve the target
tests/folder from the provided path. - Delegate to the canonical
@webstir-io/webstir-testingscaffold helper. - Write the template if it does not already exist.
Outputs
- New test file:
<resolved-tests-folder>/<name>.test.ts.
Errors & Exit Codes
- Non-zero if the path is invalid, the file exists, or file IO fails.