mirror of
https://github.com/priyanshujain/sanderling.git
synced 2026-10-02 19:17:10 +00:00
test+docs: cover --clear-data flag in CLI parser test and reference
This commit is contained in:
1 parent
d489000f63
commit
407b4a0648
2 files changed
+18
No files matched your search
@@ -32,6 +32,23 @@ func TestParseTestArgs_Defaults(t *testing.T) {
|
||||
if options.seed != 0 {
|
||||
t.Errorf("seed default: got %d, want 0", options.seed)
|
||||
}
|
||||
if options.clearData {
|
||||
t.Errorf("clearData default: got true, want false")
|
||||
}
|
||||
}
|
||||
|
||||
func TestParseTestArgs_ClearDataFlag(t *testing.T) {
|
||||
options, err := parseTestArgs([]string{
|
||||
"--spec", "s.ts",
|
||||
"--bundle-id", "com.example",
|
||||
"--clear-data",
|
||||
}, io.Discard)
|
||||
if err != nil {
|
||||
t.Fatalf("unexpected error: %v", err)
|
||||
}
|
||||
if !options.clearData {
|
||||
t.Errorf("expected clearData=true, got false")
|
||||
}
|
||||
}
|
||||
|
||||
func TestParseTestArgs_AllFlags(t *testing.T) {
|
||||
|
||||
@@ -22,6 +22,7 @@ Run a spec against an app for a fixed duration.
|
||||
| `--duration` | `5m` | Total test duration (`30s`, `5m`, `2h`, `1d`). |
|
||||
| `--seed` | `0` | PRNG seed. `0` uses a random seed and records it in `meta.json`. |
|
||||
| `--output` | `./runs` | Output directory for traces. |
|
||||
| `--clear-data` | `false` | Clear app data before launching so the run starts from a fresh install. |
|
||||
|
||||
## `sanderling inspect [run-or-runs-dir]`
|
||||
|
||||
|
||||
Reference in new issue
Block a user