i´m trying to check several requirements on a html body, received by the node-module request with jasmine-node.
The normal case would be to write something like this:
describe("check website body", function() {
it("should contain 1st requirement", function(done) {
request("url...", function(error, response, body) {
//check here the body for the first requirement
done();
});
});
it("should contain 2nd requirement", function(done) {
request("url...", function(error, response, body) {
//check here the body for the 2nd requirement
});
done();
});
});
What i would like to have is to call the website directly after the describe line and than pass body to the specific tests.
UPDDATE: To clarify: My intention is to only call the url once for my tests, not twice.
could someone can give me a hint how to do this?
Thanks and kind regards