@@ -52,7 +52,7 @@ By default, it will track coverage for any file with a `*.schema.json`,
52
52
` *.schema.yaml ` , or ` *.schema.yml ` extension. You can change this with the
53
53
` include ` option. For example, if you keep your schemas in a folder called
54
54
` schemas ` and they just have plain extensions (` *.json ` ) instead of schema
55
- extensions ` *.schema.json ` , you could use ` ["schemas/**/*.json"] ` .
55
+ extensions ( ` *.schema.json ` ) , you could use ` ["schemas/**/*.json"] ` .
56
56
57
57
If you use custom keywords, vocabularies, and dialects, you'll need to
58
58
register them with a [ globalSetup] ( https://vitest.dev/config/#globalsetup )
@@ -105,6 +105,7 @@ for the validation to work.
105
105
106
106
``` JavaScript
107
107
import { describe , expect , test } from " vitest" ;
108
+ import { registerSchema , unregisterSchema } from " @hyperjump/json-schema-coverage/vitest" ;
108
109
109
110
describe (" Worksheet" , () => {
110
111
beforeEach (async () => {
@@ -127,7 +128,7 @@ describe("Worksheet", () => {
127
128
});
128
129
```
129
130
130
- You can also use the matcher with inline schemas, but you only get coverage for
131
+ You can also use the matchers with inline schemas, but you only get coverage for
131
132
schemas from files in your code base.
132
133
133
134
``` JavaScript
@@ -228,16 +229,17 @@ example of how to use the evaluation plugin.
228
229
### Nyc Example
229
230
230
231
The following is an example of using the Low-Level API to generate coverage
231
- without Vitest. This uses the [ nyc] CLI to generate reports from the coverage
232
- files that are generated. Once you run the script, you can run the following
233
- command to generate a report.
232
+ without Vitest. This uses [ istanbul] 's [ nyc] CLI to generate reports from the
233
+ coverage files that are generated.
234
234
235
235
Keep in mind that with the Low-Level API approach, you need to configure
236
236
[ @hyperjump/json-schema ] yourself. That means that you need to import the
237
237
dialects you need and will need to provide ` MediaTypePlugin ` s for anything other
238
238
than ` *.schema.json ` file extension support. YAML support is only provided
239
239
out-of-the-box for the Vitest integration.
240
240
241
+ Once you run the script, you can run the following command to generate a report.
242
+
241
243
``` bash
242
244
npx nyc report --extension .schema.json
243
245
```
0 commit comments