(t, expected)
| 635 | }) |
| 636 | |
| 637 | function postServer (t, expected) { |
| 638 | return function (req, res) { |
| 639 | t.strictEqual(req.url, '/') |
| 640 | t.strictEqual(req.method, 'POST') |
| 641 | t.notStrictEqual(req.headers['content-length'], null) |
| 642 | |
| 643 | req.setEncoding('utf8') |
| 644 | let data = '' |
| 645 | |
| 646 | req.on('data', function (d) { data += d }) |
| 647 | |
| 648 | req.on('end', () => { |
| 649 | t.strictEqual(data, expected) |
| 650 | res.end('hello') |
| 651 | }) |
| 652 | } |
| 653 | } |
| 654 | |
| 655 | test('basic POST with string', async (t) => { |
| 656 | t = tspl(t, { plan: 7 }) |
no test coverage detected
searching dependent graphs…