Skip to content

Commit 8695ab3

Browse files
committed
Add How to test your declarations
1 parent e98ca89 commit 8695ab3

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
---
2+
title: "Test your declarations"
3+
weight: 4
4+
---
5+
6+
# Test your declarations
7+
8+
When creating or modifying service declarations, it's important to verify they work as expected. Let's see how to test your declarations in different ways.
9+
10+
## Full testing
11+
12+
To test your declarations by actually fetching the documents and validating the entire process:
13+
14+
```sh
15+
npx ota validate declarations
16+
```
17+
18+
It is also possible to test a single service declaration:
19+
20+
```sh
21+
npx ota validate declarations --services "<service-name>"
22+
```
23+
24+
Even a single terms of a service can be tested:
25+
26+
```sh
27+
npx ota validate declarations --services "<service-name>" --terms "<terms-type>"
28+
```
29+
30+
## Schema validation only
31+
32+
For quicker validation that only checks the declaration structure without fetching any documents:
33+
34+
```sh
35+
npx ota validate declarations --schema-only
36+
```
37+
38+
This is useful during initial development to ensure your JSON structure is correct before testing the actual document fetching.
39+
40+
Same options as for the full test are available.
41+
42+
## Linting declarations
43+
44+
To ensure consistency across all declarations, you should also run the linter:
45+
46+
```sh
47+
npx ota lint
48+
```
49+
50+
Same options as for the full test are available.
51+
52+
To automatically fix linting errors:
53+
54+
```sh
55+
npx ota lint --fix
56+
```
57+
58+
This will format your declaration files according to the project's standards.

0 commit comments

Comments
 (0)