Compare commits
2 Commits
542510f5d0
...
ee767d8067
Author | SHA1 | Date | |
---|---|---|---|
|
ee767d8067 | ||
|
29d579b8ac |
@ -8,6 +8,7 @@ function match(message, headers) {
|
||||
}
|
||||
|
||||
function body(message) {
|
||||
if (message["body"] !== undefined) {
|
||||
if (message["body"][0]["content-type"] === "text/plain") {
|
||||
return message["body"][0]["content"];
|
||||
}
|
||||
@ -16,6 +17,8 @@ function body(message) {
|
||||
return message["body"][0]["content"][0]["content"];
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
function string(message) {
|
||||
let string = "";
|
||||
|
@ -51,6 +51,10 @@ ciao,
|
||||
Marco
|
||||
`);
|
||||
});
|
||||
it("no body",
|
||||
function() {
|
||||
expect(message.body(testMsg)).toEqual(undefined)
|
||||
});
|
||||
|
||||
});
|
||||
let fullHeaderMsg ={"headers": {
|
||||
|
Loading…
Reference in New Issue
Block a user