Commit abf529a
committed
docs: Add comprehensive testing guide for zx scripts
- Add complete testing documentation at docs/testing.md
- Add working example script at examples/testing-example.mjs
- Add complete test suite example at examples/testing-example.test.mjs
- Update VitePress config to include testing guide in navigation
Fixes #1297
This PR addresses the issue asking for best practices on how to test zx scripts.
The documentation covers:
- Mocking $.spawn for unit testing
- Using custom spawn functions
- Extracting logic to testable functions
- Integration testing approaches
- Context isolation with within()
- Complete working examples
All examples have been tested and verified to work correctly.1 parent 327bfaa commit abf529a
File tree
4 files changed
+737
-0
lines changed- docs
- .vitepress
- examples
4 files changed
+737
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| 70 | + | |
70 | 71 | | |
71 | 72 | | |
72 | 73 | | |
| |||
0 commit comments