mirror of
https://github.com/brianc/node-postgres.git
synced 2026-01-25 16:03:13 +00:00
When enabling this rule, it's recommended to also *disable* the standard `no-unused-vars` rule. Although `no-unused-vars` is not currently enabled, it seems helpful to explicitly disable it here. See: https://typescript-eslint.io/rules/no-unused-vars/ Co-authored-by: alxndrsn <alxndrsn>
31 lines
1.1 KiB
JavaScript
31 lines
1.1 KiB
JavaScript
'use strict'
|
|
const helper = require('./../test-helper')
|
|
const assert = require('assert')
|
|
const util = require('util')
|
|
|
|
const suite = new helper.Suite()
|
|
|
|
const password = 'FAIL THIS TEST'
|
|
|
|
suite.test('Password should not exist in toString() output', () => {
|
|
const pool = new helper.pg.Pool({ password })
|
|
const client = new helper.pg.Client({ password })
|
|
assert(pool.toString().indexOf(password) === -1)
|
|
assert(client.toString().indexOf(password) === -1)
|
|
})
|
|
|
|
suite.test('Password should not exist in util.inspect output', () => {
|
|
const pool = new helper.pg.Pool({ password })
|
|
const client = new helper.pg.Client({ password })
|
|
const depth = 20
|
|
assert(util.inspect(pool, { depth }).indexOf(password) === -1)
|
|
assert(util.inspect(client, { depth }).indexOf(password) === -1)
|
|
})
|
|
|
|
suite.test('Password should not exist in json.stringfy output', () => {
|
|
const pool = new helper.pg.Pool({ password })
|
|
const client = new helper.pg.Client({ password })
|
|
assert(JSON.stringify(pool).indexOf(password) === -1)
|
|
assert(JSON.stringify(client).indexOf(password) === -1)
|
|
})
|