Skip to content

Commit 322e1f6

Browse files
committed
Add snapshot tests
1 parent 52d1544 commit 322e1f6

14 files changed

+5314
-14
lines changed

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
coverage.png
44
eslint.config.js
55
**/*.test.js
6+
src/test-utils.js
67
tsconfig.json
78
scratch/
89
docs/

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,12 @@ without Vitest. This uses the [nyc] CLI to generate reports from the coverage
250250
files that are generated. Once you run the script, you can run the following
251251
command to generate a report.
252252

253+
Keep in mind that with the Low-Level API approach, you need to configure
254+
[@hyperjump/json-schema] yourself. That means that you need to import the
255+
dialects you need and will need to provide `MediaTypePlugin`s for anything other
256+
than `*.schema.json` file extension support. YAML support is only provided
257+
out-of-the-box for the Vitest integration.
258+
253259
```bash
254260
npx nyc report --extension .schema.json
255261
```

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
},
2323
"scripts": {
2424
"lint": "eslint src",
25-
"test": "vitest run",
25+
"test": "vitest run --config src/vitest/vitest-json-schema.config.js",
26+
"test:coverage": "vitest run --coverage",
2627
"type-check": "tsc --noEmit",
2728
"docs": "typedoc --excludeExternals"
2829
},
@@ -34,13 +35,15 @@
3435
"@types/moo": "^0.5.10",
3536
"@types/node": "*",
3637
"@types/unist": "^3.0.3",
38+
"@vitest/coverage-v8": "^3.2.4",
3739
"eslint-import-resolver-typescript": "*",
3840
"eslint-plugin-import": "*",
3941
"typedoc": "*",
4042
"typescript-eslint": "*",
4143
"vitest": "*"
4244
},
4345
"dependencies": {
46+
"@hyperjump/browser": "^1.3.1",
4447
"@hyperjump/json-schema": "^1.16.0",
4548
"@hyperjump/uri": "^1.3.1",
4649
"content-type": "^1.0.5",

0 commit comments

Comments
 (0)