Commit 4f76ebe
committed
test(dlx): add comprehensive cross-platform binary resolution tests
Add extensive test coverage for dlx binary resolution and CLI-style options:
Binary resolution tests (dlx-package.test.ts):
- Windows .cmd wrapper resolution
- Windows .ps1 wrapper resolution
- Windows .exe direct execution
- Unix bare path usage (no wrappers)
- Missing binary error handling
- Single binary auto-selection
- Multiple binaries with correct selection
- Fallback to first binary when name doesn't match
- Windows wrapper priority order (.cmd, .bat, .ps1, .exe, bare)
Option interface tests:
- yes flag (CLI-style, maps to force)
- quiet flag (CLI-style, reserved for future use)
- call flag (CLI-style, reserved for future use)
- yes + force interaction
DlxBinaryOptions tests (dlx-binary.test.ts):
- yes flag force re-download behavior
- quiet flag acceptance
These tests verify:
- Cross-platform compatibility (Windows vs Unix)
- npm/npx binary resolution alignment
- CLI-style option naming for cognitive consistency
- Error handling for edge cases
- Auto-detection logic for binary selection1 parent 9358a86 commit 4f76ebe
2 files changed
Lines changed: 440 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
190 | 239 | | |
191 | 240 | | |
192 | 241 | | |
| |||
0 commit comments