From 6b088df9c6f1260ddff5ff36798d1c398b537ade Mon Sep 17 00:00:00 2001 From: alxndrsn Date: Wed, 19 Jun 2024 15:11:47 +0000 Subject: [PATCH] eslint: add rule: no-unreachable Also delete tests which have not been enabled since 2017. --- .eslintrc | 3 ++- .../pg/test/integration/client/ssl-tests.js | 21 ------------------- .../pg/test/unit/client/simple-query-tests.js | 12 ----------- 3 files changed, 2 insertions(+), 34 deletions(-) delete mode 100644 packages/pg/test/integration/client/ssl-tests.js diff --git a/.eslintrc b/.eslintrc index fd9bb8ddc..3ea313b51 100644 --- a/.eslintrc +++ b/.eslintrc @@ -16,6 +16,7 @@ "@typescript-eslint/no-unused-vars": ["error", { "args": "none" }], - "no-unused-vars": "off" + "no-unused-vars": "off", + "no-unreachable": "error" } } diff --git a/packages/pg/test/integration/client/ssl-tests.js b/packages/pg/test/integration/client/ssl-tests.js deleted file mode 100644 index 97aa59492..000000000 --- a/packages/pg/test/integration/client/ssl-tests.js +++ /dev/null @@ -1,21 +0,0 @@ -'use strict' -var pg = require('../../../lib') -var config = require('./test-helper').config -test('can connect with ssl', function () { - return false - config.ssl = { - rejectUnauthorized: false, - } - pg.connect( - config, - assert.success(function (client) { - return false - client.query( - 'SELECT NOW()', - assert.success(function () { - pg.end() - }) - ) - }) - ) -}) diff --git a/packages/pg/test/unit/client/simple-query-tests.js b/packages/pg/test/unit/client/simple-query-tests.js index 2c3ea5e4e..d7a893a1f 100644 --- a/packages/pg/test/unit/client/simple-query-tests.js +++ b/packages/pg/test/unit/client/simple-query-tests.js @@ -109,18 +109,6 @@ test('executing query', function () { text: 'INSERT 31 1', }) }) - - test('removes itself after another readyForQuery message', function () { - return false - assert.emits(query, 'end', function (msg) { - // TODO do we want to check the complete messages? - }) - con.emit('readyForQuery') - // this would never actually happen - ;['dataRow', 'rowDescription', 'commandComplete'].forEach(function (msg) { - assert.equal(con.emit(msg), false, "Should no longer be picking up '" + msg + "' messages") - }) - }) }) test('handles errors', function () {