Compare commits
2 Commits
542510f5d0
...
ee767d8067
Author | SHA1 | Date | |
---|---|---|---|
|
ee767d8067 | ||
|
29d579b8ac |
@ -8,13 +8,16 @@ function match(message, headers) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function body(message) {
|
function body(message) {
|
||||||
if (message["body"][0]["content-type"] === "text/plain") {
|
if (message["body"] !== undefined) {
|
||||||
return message["body"][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") {
|
/* istanbul ignore else */
|
||||||
return message["body"][0]["content"][0]["content"];
|
if (message["body"][0]["content-type"] === "multipart/signed") {
|
||||||
|
return message["body"][0]["content"][0]["content"];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
function string(message) {
|
function string(message) {
|
||||||
|
@ -19,7 +19,7 @@ describe("match",
|
|||||||
expect(message.match(testMsg,{"Subject": "lunch"})).toEqual(true);
|
expect(message.match(testMsg,{"Subject": "lunch"})).toEqual(true);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
describe("message body",
|
describe("message body",
|
||||||
function () {
|
function () {
|
||||||
it("unsigned message",
|
it("unsigned message",
|
||||||
function () {
|
function () {
|
||||||
@ -51,6 +51,10 @@ ciao,
|
|||||||
Marco
|
Marco
|
||||||
`);
|
`);
|
||||||
});
|
});
|
||||||
|
it("no body",
|
||||||
|
function() {
|
||||||
|
expect(message.body(testMsg)).toEqual(undefined)
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
let fullHeaderMsg ={"headers": {
|
let fullHeaderMsg ={"headers": {
|
||||||
|
Loading…
Reference in New Issue
Block a user