Skip to content

Commit

Permalink
feat(tests): support json schema validation
Browse files Browse the repository at this point in the history
  • Loading branch information
kobenguyent authored and gatzjames committed Nov 14, 2023
1 parent 40fe4aa commit 6fa08b9
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
29 changes: 29 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions packages/insomnia-testing/src/run/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ const runInternal = async <TReturn, TNetworkResponse>(
// This is the only way to add new globals to the Mocha environment as far as I can tell
// @ts-expect-error -- global hack
global.insomnia = new Insomnia(options);

// eslint-disable-next-line @typescript-eslint/no-var-requires
chai.use(require('chai-json-schema'));
// @ts-expect-error -- global hack
global.chai = chai;

Expand Down
1 change: 1 addition & 0 deletions packages/insomnia/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"aws4": "^1.12.0",
"axios": "^1.4.0",
"chai": "^4.3.4",
"chai-json-schema": "1.5.1",
"change-case": "^4.1.2",
"clone": "^2.1.0",
"color": "^3.1.2",
Expand Down

0 comments on commit 6fa08b9

Please sign in to comment.