MCPcopy
hub / github.com/brianc/node-postgres / verifyMessages

Function verifyMessages

packages/pg-protocol/src/inbound-parser.test.ts:522–536  ·  view source on GitHub ↗
(messages: any[])

Source from the content-addressed store, hash-verified

520 readyForQueryBuffer.copy(fullBuffer, dataRowBuffer.length, 0)
521
522 const verifyMessages = function (messages: any[]) {
523 assert.strictEqual(messages.length, 2)
524 assert.deepEqual(messages[0], {
525 name: 'dataRow',
526 fieldCount: 1,
527 length: 11,
528 fields: ['!'],
529 })
530 assert.equal(messages[0].fields[0], '!')
531 assert.deepEqual(messages[1], {
532 name: 'readyForQuery',
533 length: 5,
534 status: 'I',
535 })
536 }
537 // sanity check
538 it('receives both messages when packet is not split', async function () {
539 const messages = await parseBuffers([fullBuffer])

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected