@@ -52,7 +52,7 @@ By default, it will track coverage for any file with a `*.schema.json`,
5252` *.schema.yaml ` , or ` *.schema.yml ` extension. You can change this with the
5353` include ` option. For example, if you keep your schemas in a folder called
5454` 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"] ` .
5656
5757If you use custom keywords, vocabularies, and dialects, you'll need to
5858register them with a [ globalSetup] ( https://vitest.dev/config/#globalsetup )
@@ -105,6 +105,7 @@ for the validation to work.
105105
106106``` JavaScript
107107import { describe , expect , test } from " vitest" ;
108+ import { registerSchema , unregisterSchema } from " @hyperjump/json-schema-coverage/vitest" ;
108109
109110describe (" Worksheet" , () => {
110111 beforeEach (async () => {
@@ -127,7 +128,7 @@ describe("Worksheet", () => {
127128});
128129```
129130
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
131132schemas from files in your code base.
132133
133134``` JavaScript
@@ -228,16 +229,17 @@ example of how to use the evaluation plugin.
228229### Nyc Example
229230
230231The 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.
234234
235235Keep in mind that with the Low-Level API approach, you need to configure
236236[ @hyperjump/json-schema ] yourself. That means that you need to import the
237237dialects you need and will need to provide ` MediaTypePlugin ` s for anything other
238238than ` *.schema.json ` file extension support. YAML support is only provided
239239out-of-the-box for the Vitest integration.
240240
241+ Once you run the script, you can run the following command to generate a report.
242+
241243``` bash
242244npx nyc report --extension .schema.json
243245```
0 commit comments