Skip to content

Commit 93fac44

Browse files
committed
Improve Test your declarations page
1 parent e3fddeb commit 93fac44

File tree

1 file changed

+11
-20
lines changed

1 file changed

+11
-20
lines changed

content/terms/how-to/test-declaration.md

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,54 +5,45 @@ weight: 4
55

66
# Test your declarations
77

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.
8+
When creating or modifying service declarations, its important to verify they work as expected before starting to track in production. The Open Terms Archive engine provides automated testing tools to that end.
99

10-
## Full testing
11-
12-
To test your declarations by actually fetching the documents and validating the entire process:
10+
The basic usage to test all declarations in a collection is:
1311

1412
```sh
1513
npx ota validate declarations
1614
```
1715

18-
It is also possible to test a single service declaration:
19-
20-
```sh
21-
npx ota validate declarations --services "<service-name>"
22-
```
16+
## Testing specific services
2317

24-
Even a single terms of a service can be tested:
18+
When iterating over a specific declaration, or to narrow down testing in larger collections, the `--services` and `--terms` options enable testing a single service declaration, or even single terms:
2519

2620
```sh
21+
npx ota validate declarations --services "<service-name>"
2722
npx ota validate declarations --services "<service-name>" --terms "<terms-type>"
2823
```
2924

3025
## Schema validation only
3126

32-
For quicker validation that only checks the declaration structure without fetching any documents:
27+
During initial development, it is useful to check that the JSON structure is correct before even testing the actual document fetching. The `--schema-only` option enables faster validation by only checking the declaration structure without fetching any documents:
3328

3429
```sh
3530
npx ota validate declarations --schema-only
3631
```
3732

38-
This is useful during initial development to ensure your JSON structure is correct before testing the actual document fetching.
33+
The same options for targeting specific services and terms are available.
3934

40-
Same options as for the full test are available.
35+
## Formatting
4136

42-
## Linting declarations
43-
44-
To ensure consistency across all declarations, you should also run the linter:
37+
To ensure formatting consistency across all declarations, a linter is provided:
4538

4639
```sh
4740
npx ota lint
4841
```
4942

50-
Same options as for the full test are available.
51-
52-
To automatically fix linting errors:
43+
To automatically apply the default Open Terms Archive formatting options:
5344

5445
```sh
5546
npx ota lint --fix
5647
```
5748

58-
This will format your declaration files according to the project's standards.
49+
The same options for targeting specific services and terms are available.

0 commit comments

Comments
 (0)