Skip to content

Commit

Permalink
fix: manhandle tests into working state
Browse files Browse the repository at this point in the history
  • Loading branch information
BelfordZ committed Mar 19, 2020
1 parent 10540e5 commit 5980836
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 15 deletions.
14 changes: 7 additions & 7 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"devDependencies": {
"@etclabscore/dl-github-releases": "^1.1.0",
"@etclabscore/json-schema-to-types": "^1.9.0",
"ajv": "^6.10.0",
"ajv": "^6.12.0",
"fs-extra": "^8.0.0",
"jest": "^24.3.1",
"json-schema-ref-parser": "^7.1.3",
Expand Down
4 changes: 2 additions & 2 deletions schema.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://json-schema.org/draft-07/schema#",
"$schema": "https://json-schema.org/draft-07/schema",
"$id": "https://raw.githubusercontent.com/open-rpc/meta-schema/master/schema.json",
"title": "openrpcDocument",
"type": "object",
Expand Down Expand Up @@ -109,7 +109,7 @@
},
"definitions": {
"schema": {
"$ref": "https://json-schema.org/draft-07/schema#"
"$ref": "https://json-schema.org/draft-07/schema"
},
"referenceObject": {
"title": "referenceObject",
Expand Down
7 changes: 2 additions & 5 deletions src/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,13 @@ const testOpenRPCDocument = {
openrpc: "1.0.0",
};

const getJsonSchemaDraft7 = async () => ajv.addMetaSchema(
await fetch("https://json-schema.org/draft-07/schema").then((res) => res.json()),
"https://json-schema.org/draft-07/schema#"
);

let metaSchema;
describe('validates all examples without error', () => {
beforeAll(async () =>{
metaSchema = await setOpenRPCVersionEnum(require('../schema.json'));
await getJsonSchemaDraft7();
delete metaSchema.definitions.schema.$ref;
delete metaSchema.$schema;
});

it("can validate a simple document", () => {
Expand Down

0 comments on commit 5980836

Please sign in to comment.