2023-02-03 00:09:45 +01:00
|
|
|
const parser = require("../src/index");
|
|
|
|
|
|
|
|
describe("parser", () => {
|
|
|
|
it("should parse headers", () => {
|
2023-02-03 03:31:44 +01:00
|
|
|
const input = `
|
|
|
|
headers {
|
|
|
|
hello: world
|
|
|
|
foo: bar
|
|
|
|
}`;
|
2023-02-03 00:09:45 +01:00
|
|
|
|
2023-02-03 03:31:44 +01:00
|
|
|
const output = parser(input);
|
|
|
|
console.log(output);
|
|
|
|
});
|
|
|
|
|
|
|
|
it("should parse script body", () => {
|
|
|
|
const input = `
|
|
|
|
script {
|
|
|
|
function onResponse(request, response) {
|
|
|
|
expect(response.status).to.equal(200);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
2023-02-03 00:09:45 +01:00
|
|
|
|
2023-02-03 03:31:44 +01:00
|
|
|
const output = parser(input);
|
|
|
|
console.log(output);
|
2023-02-03 00:09:45 +01:00
|
|
|
});
|
|
|
|
});
|