()
| 551 | } |
| 552 | |
| 553 | function TEST_parseMessage() { |
| 554 | const exampleMessage = Buffer.from("1 2 3\nGET / HTTP/1.1\r\n\r\n").toString('hex') |
| 555 | let msg = parseMessage(exampleMessage) |
| 556 | let expected = { type: '1', ID: '2', meta: ["1", "2", "3"], http: Buffer.from("GET / HTTP/1.1\r\n\r\n") } |
| 557 | |
| 558 | Object.keys(expected).forEach(function(k){ |
| 559 | if (msg[k].toString() != expected[k].toString()) { |
| 560 | fail(`${k}: '${expected[k]}' != '${msg[k]}'`) |
| 561 | } |
| 562 | }) |
| 563 | } |
| 564 | |
| 565 | function TEST_httpPath() { |
| 566 | const examplePayload = "GET /test HTTP/1.1\r\n\r\n"; |
nothing calls this directly
no test coverage detected