Skip to content

Commit

Permalink
fix: update template to work with @asyncapi/parser 2.x (#272)
Browse files Browse the repository at this point in the history
  • Loading branch information
ivankahl committed Mar 30, 2023
1 parent be8bdee commit 18f3adf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions template/src/lib/asyncapi.js
@@ -1,6 +1,8 @@
const fs = require('fs');
const path = require('path');
const { parse } = require('@asyncapi/parser');
const { Parser } = require('@asyncapi/parser');

const parser = new Parser();

let cached;

Expand All @@ -20,7 +22,7 @@ module.exports.init = async () => {
}

try {
cached = await parse(content);
cached = await parser.parse(content);
} catch (e) {
throw e;
}
Expand Down
6 changes: 4 additions & 2 deletions test/__snapshots__/integration.test.js.snap
Expand Up @@ -55,7 +55,9 @@ router.ws('/echo', async (ws, req) => {
exports[`template integration test using generator should generate application files 3`] = `
"const fs = require('fs');
const path = require('path');
const { parse } = require('@asyncapi/parser');
const { Parser } = require('@asyncapi/parser');
const parser = new Parser();
let cached;
Expand All @@ -75,7 +77,7 @@ module.exports.init = async () => {
}
try {
cached = await parse(content);
cached = await parser.parse(content);
} catch (e) {
throw e;
}
Expand Down

0 comments on commit 18f3adf

Please sign in to comment.