bruno/packages/bruno-lang/v2/tests/index.spec.js

25 lines
766 B
JavaScript
Raw Normal View History

const fs = require('fs');
const path = require('path');
const bruToJson = require('../src/bruToJson');
const jsonToBru = require('../src/jsonToBru');
2023-02-03 00:09:45 +01:00
describe('bruToJson', () => {
it('should parse the bru file', () => {
const input = fs.readFileSync(path.join(__dirname, 'fixtures', 'request.bru'), 'utf8');
const expected = require('./fixtures/request.json');
const output = bruToJson(input);
expect(output).toEqual(expected);
});
});
describe('jsonToBru', () => {
it('should parse the bru file', () => {
const input = require('./fixtures/request.json');
const expected = fs.readFileSync(path.join(__dirname, 'fixtures', 'request.bru'), 'utf8');
const output = jsonToBru(input);
expect(output).toEqual(expected);
2023-02-03 00:09:45 +01:00
});
});