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

21 lines
503 B
JavaScript
Raw Normal View History

2023-02-04 11:36:32 +01:00
/**
* This test file is used to test the text parser.
*/
const parser = require("../src/bruToJson");
describe("script parser", () => {
it("should parse script body", () => {
const input = `
script {
function onResponse(request, response) {
expect(response.status).to.equal(200);
}
}
`;
const output = parser(input);
const expected = "function onResponse(request, response) {\n expect(response.status).to.equal(200);\n}";
expect(output.script).toEqual(expected);
});
});