You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: website/docs/docs/ai/using.md
+40Lines changed: 40 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -353,6 +353,46 @@ This would instruct the test generation process to read the file content and use
353
353
* Use the PactV4 interface
354
354
```
355
355
356
+
### Reviewing Pact Tests
357
+
358
+
Use the `pactflow-ai review` command to check an existing Pact test against best practices.
359
+
360
+
:::note
361
+
This feature is currently in beta. Supported languages include JavaScript and Java.
362
+
:::
363
+
364
+
```sh
365
+
pactflow-ai review \
366
+
--test ./src/api.pact.spec.ts \
367
+
--code ./src/api.js \
368
+
--code ./src/product.js
369
+
```
370
+
371
+
#### Applying Changes
372
+
373
+
By default, the review command provides feedback and suggested changes without modifying files.
374
+
375
+
To apply the suggestions automatically, use the `--apply` flag:
376
+
377
+
```sh
378
+
pactflow-ai review \
379
+
--test ./test.js \
380
+
--code ./src.js \
381
+
--apply
382
+
```
383
+
384
+
The command requires a clean Git state to avoid introducing irreversible changes. If the file is not part of a Git repository, or if it has uncommitted or staged changes, the command will fail.
385
+
386
+
To override this behavior, use one or more of the following flags:
387
+
388
+
-`--allow-no-vcs` – Allow editing files not tracked in a Git repository.
389
+
-`--allow-dirty` – Allow changes to files with uncommitted modifications.
390
+
-`--allow-staged` – Allow changes to files with staged but uncommitted changes.
391
+
392
+
:::tip
393
+
Run `pactflow-ai review --help` to see all available options and usage examples.
0 commit comments