2023-02-04 11:41:29 +01:00
|
|
|
const fs = require("fs");
|
|
|
|
const path = require("path");
|
2023-02-04 15:41:33 +01:00
|
|
|
const parser = require("../src/bruToJson");
|
2023-02-03 00:09:45 +01:00
|
|
|
|
|
|
|
describe("parser", () => {
|
2023-02-03 16:38:40 +01:00
|
|
|
it("should parse the bru file", () => {
|
2023-02-04 11:41:29 +01:00
|
|
|
const input = fs.readFileSync(path.join(__dirname, 'fixtures', 'request.bru'), 'utf8');
|
|
|
|
const expected = require("./fixtures/request.json");
|
2023-02-03 03:31:44 +01:00
|
|
|
const output = parser(input);
|
2023-02-03 18:57:06 +01:00
|
|
|
|
2023-02-04 01:36:02 +01:00
|
|
|
// console.log(JSON.stringify(output, null, 2));
|
2023-02-03 16:38:40 +01:00
|
|
|
expect(output).toEqual(expected);
|
2023-02-03 00:09:45 +01:00
|
|
|
});
|
|
|
|
});
|