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

Function runErrorQuery

packages/pg-pool/test/error-handling.js:16–29  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

14 let errors = 0
15 let shouldGet = 0
16 function runErrorQuery() {
17 shouldGet++
18 return new Promise(function (resolve, reject) {
19 pool
20 .query("SELECT 'asd'+1 ")
21 .then(function (res) {
22 reject(res) // this should always error
23 })
24 .catch(function (err) {
25 errors++
26 resolve(err)
27 })
28 })
29 }
30 const ps = []
31 for (let i = 0; i < 5; i++) {
32 ps.push(runErrorQuery())

Callers 1

error-handling.jsFile · 0.70

Calls 1

queryMethod · 0.45

Tested by

no test coverage detected