Compare commits

..

No commits in common. "ee767d8067780176bceaaf9b9069f76cd5a39ca2" and "542510f5d0b22f105c962d757f5e89e4b8dffd05" have entirely different histories.

2 changed files with 7 additions and 14 deletions

View File

@ -8,16 +8,13 @@ function match(message, headers) {
}
function body(message) {
if (message["body"] !== undefined) {
if (message["body"][0]["content-type"] === "text/plain") {
return message["body"][0]["content"];
}
/* istanbul ignore else */
if (message["body"][0]["content-type"] === "multipart/signed") {
return message["body"][0]["content"][0]["content"];
}
if (message["body"][0]["content-type"] === "text/plain") {
return message["body"][0]["content"];
}
/* istanbul ignore else */
if (message["body"][0]["content-type"] === "multipart/signed") {
return message["body"][0]["content"][0]["content"];
}
return undefined;
}
function string(message) {

View File

@ -19,7 +19,7 @@ describe("match",
expect(message.match(testMsg,{"Subject": "lunch"})).toEqual(true);
});
});
describe("message body",
describe("message body",
function () {
it("unsigned message",
function () {
@ -51,10 +51,6 @@ ciao,
Marco
`);
});
it("no body",
function() {
expect(message.body(testMsg)).toEqual(undefined)
});
});
let fullHeaderMsg ={"headers": {