Skip to content

Commit 0678c1a

Browse files
committed
Fix coverage ignore comments
1 parent b9f513d commit 0678c1a

File tree

4 files changed

+10
-28
lines changed

4 files changed

+10
-28
lines changed

lib/backend.js

+6-22
Original file line numberDiff line numberDiff line change
@@ -51,23 +51,15 @@ function Backend({
5151
secret : null
5252
}
5353

54-
/* c8 ignore next 3 */
5554
function ParseComplete() {
5655
onparse()
5756
}
5857

59-
/* c8 ignore next 3 */
60-
function BindComplete() {
61-
/* No handling needed */
62-
}
63-
64-
/* c8 ignore next 3 */
65-
function CloseComplete() {
66-
/* No handling needed */
67-
}
58+
/* c8 ignore next 2 */
59+
function BindComplete() { /* No handling needed */ }
60+
function CloseComplete() { /* No handling needed */ }
6861

6962
function NotificationResponse(x) {
70-
/* c8 ignore next 2 */
7163
if (!onnotify)
7264
return
7365

@@ -80,7 +72,6 @@ function Backend({
8072
}
8173

8274
function CommandComplete(x) {
83-
/* c8 ignore next 2 */
8475
if (!backend.query)
8576
return
8677

@@ -126,9 +117,7 @@ function Backend({
126117
}
127118

128119
/* c8 ignore next 3 */
129-
function CopyData() {
130-
/* No handling needed until implemented */
131-
}
120+
function CopyData() { /* No handling needed until implemented */ }
132121

133122
function ErrorResponse(x) {
134123
backend.query
@@ -165,12 +154,8 @@ function Backend({
165154
function Authentication(x) {
166155
const type = x.readInt32BE(5)
167156
try {
168-
type !== 0 && onauth(type, x)
169-
}
170-
/* c8 ignore next 3 */
171-
catch (err) {
172-
error(err)
173-
}
157+
type !== 0 && onauth(type, x, error)
158+
} /* c8 ignore next */ catch (err) { error(err) }
174159
}
175160

176161
function ParameterStatus(x) {
@@ -232,7 +217,6 @@ function Backend({
232217
onready(backend.error)
233218
}
234219

235-
/* c8 ignore next */
236220
return backend
237221
}
238222

lib/bytes.js

-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ const b = {
6767
const out = buffer.slice(0, b.i)
6868
b.i = 0
6969
buffer = Buffer.allocUnsafe(size)
70-
/* c8 ignore next */
7170
return out
7271
}
7372
}

lib/connection.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,8 @@ function postgresSocket(options, {
193193
}
194194

195195
function connect() {
196-
/* c8 ignore next */
197-
if (!closed) return
196+
if (!closed)
197+
return
198198

199199
closed = false
200200

@@ -213,8 +213,7 @@ function postgresSocket(options, {
213213
socket.removeListener('close', onclose)
214214
x.toString() === 'S'
215215
? attach(tls.connect(Object.assign({ socket }, options.ssl)))
216-
/* c8 ignore next */
217-
: error('Server does not support SSL')
216+
: /* c8 ignore next */ error('Server does not support SSL')
218217
})
219218
}
220219

lib/frontend.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ function connect({ user, database, connection }) {
6060
function auth(type, x, options) {
6161
if (type in auths)
6262
return auths[type](type, x, options)
63-
/* c8 ignore next 5 */
63+
/* c8 ignore next */
6464
throw errors.generic({
6565
message: 'Auth type ' + (authNames[type] || type) + ' not implemented',
6666
type: authNames[type] || type,

0 commit comments

Comments
 (0)