protobuf2swagger
Version:
Convert protobuf to swagger open api v2, v3 JSON
21 lines (19 loc) • 620 B
JavaScript
const path = require('path');
const convert = require('../lib/convert');
describe('a bit of everything', () => {
test('can work', async () => {
const protopath = path.resolve(__dirname, '__fixtures__/a_bit_of_everything.proto');
const converted = await convert({
files: [protopath],
});
expect(converted).toMatchSnapshot();
});
test('export v2', async () => {
const protopath = path.resolve(__dirname, '__fixtures__/a_bit_of_everything.proto');
const converted = await convert({
target: '2',
files: [protopath],
});
expect(converted).toMatchSnapshot();
});
});