mirror of
https://github.com/usebruno/bruno.git
synced 2025-01-04 13:09:12 +01:00
25 lines
601 B
JavaScript
25 lines
601 B
JavaScript
|
/**
|
||
|
* This test file is used to test the text parser.
|
||
|
*/
|
||
|
const parser = require("../src/bruToJson");
|
||
|
|
||
|
describe("assert parser", () => {
|
||
|
it("should parse assert statement", () => {
|
||
|
const input = `
|
||
|
assert {
|
||
|
res("data.airports").filter(a => a.code ==="BLR").name: "Bangalore International Airport"
|
||
|
}
|
||
|
`;
|
||
|
|
||
|
const output = parser(input);
|
||
|
const expected = {
|
||
|
"assert": [{
|
||
|
name: "res(\"data.airports\").filter(a => a.code ===\"BLR\").name",
|
||
|
value: '"Bangalore International Airport"',
|
||
|
enabled: true
|
||
|
}]
|
||
|
};
|
||
|
expect(output).toEqual(expected);
|
||
|
});
|
||
|
});
|