Skip to content

Commit

Permalink
fix: update @asyncapi/parser to 1.4.4 version (#142)
Browse files Browse the repository at this point in the history
* fix: update @asyncapi/parser to 1.4.4 version

* Removed any parser-specific properties from the expected output and changed the test to only looking for matching the object.

Co-authored-by: asyncapi-bot <[email protected]>
Co-authored-by: Jonas Lagoni <[email protected]>
  • Loading branch information
3 people authored Apr 13, 2021
1 parent cc42b3a commit 32bd39f
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 18 deletions.
12 changes: 9 additions & 3 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 @@ -30,7 +30,7 @@
],
"dependencies": {
"@apidevtools/json-schema-ref-parser": "^9.0.7",
"@asyncapi/parser": "^1.4.2",
"@asyncapi/parser": "^1.4.4",
"change-case": "^4.1.2"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions test/processors/AsyncAPIInputProcessor.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ describe('AsyncAPIInputProcessor', function() {
const expectedCommonInputModel = JSON.parse(expectedCommonInputModelString);
const processor = new AsyncAPIInputProcessor();
const commonInputModel = await processor.process(basicDoc);
expect(commonInputModel).toEqual(expectedCommonInputModel);
expect(commonInputModel).toMatchObject(expectedCommonInputModel);
});
test('should be able to process parsed objects', async function() {
const basicDocString = fs.readFileSync(path.resolve(__dirname, './AsyncAPIInputProcessor/basic.json'), 'utf8');
Expand All @@ -47,7 +47,7 @@ describe('AsyncAPIInputProcessor', function() {
const parsedObject = await parse(basicDocString);
const processor = new AsyncAPIInputProcessor();
const commonInputModel = await processor.process(parsedObject);
expect(commonInputModel).toEqual(expectedCommonInputModel);
expect(commonInputModel).toMatchObject(expectedCommonInputModel);
});
});

Expand Down
13 changes: 3 additions & 10 deletions test/processors/AsyncAPIInputProcessor/commonInputModel/basic.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@
"email":{
"type":"string",
"format":"email",
"x-parser-schema-id":"<anonymous-schema-2>",
"x-modelgen-inferred-name": "<anonymous-schema-2>"
}
},
"x-parser-schema-id":"<anonymous-schema-1>",
"x-modelgen-inferred-name":"<anonymous-schema-1>"
},
"type":"object",
Expand All @@ -21,7 +19,6 @@
"originalSchema":{
"type":"string",
"format":"email",
"x-parser-schema-id":"<anonymous-schema-2>",
"x-modelgen-inferred-name": "<anonymous-schema-2>"
},
"type":"string"
Expand Down Expand Up @@ -71,15 +68,11 @@
"properties":{
"email":{
"type":"string",
"format":"email",
"x-parser-schema-id":"<anonymous-schema-2>"
"format":"email"
}
},
"x-parser-schema-id":"<anonymous-schema-1>"
}
},
"schemaFormat":"application/vnd.aai.asyncapi;version=2.0.0",
"x-parser-message-parsed":true,
"x-parser-message-name":"<anonymous-message-1>"
"schemaFormat":"application/vnd.aai.asyncapi;version=2.0.0"
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions test/processors/InputProcessor.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ describe('InputProcessor', function() {
const basicDoc = JSON.parse(basicDocString);
const expectedCommonInputModel = JSON.parse(expectedCommonInputModelString);
const commonInputModel = await processor.process(basicDoc);
expect(commonInputModel).toEqual(expectedCommonInputModel);
expect(commonInputModel).toMatchObject(expectedCommonInputModel);
});
test('with parsed document', async function() {
const processor = new InputProcessor();
Expand All @@ -70,7 +70,7 @@ describe('InputProcessor', function() {
const expectedCommonInputModel = JSON.parse(expectedCommonInputModelString);
const parsedObject = await parse(basicDocString);
const commonInputModel = await processor.process(parsedObject);
expect(commonInputModel).toEqual(expectedCommonInputModel);
expect(commonInputModel).toMatchObject(expectedCommonInputModel);
});
});
});
Expand Down

0 comments on commit 32bd39f

Please sign in to comment.