{"version":3,"file":"default-pool.test.d.ts","sourceRoot":"","sources":["../src/default-pool.test.ts"],"names":[],"mappings":"","sourcesContent":["import { assert, describe, it } from 'vitest';\n\nimport * as pgPool from './default-pool.js';\nimport { PostgresPool } from './pool.js';\n\n/**\n * Properties on {@link PostgresPool} that should not be available on the default\n * pool's exports.\n */\nconst HIDDEN_PROPERTIES = new Set([\n  'constructor',\n  // Private members\n  'pool',\n  'alsClient',\n  'searchSchema',\n  '_queryCount',\n  'queryCursorWithClient',\n  'queryCursorInternal',\n  'errorOnUnusedParameters',\n  // Getters\n  'totalCount',\n  'idleCount',\n  'waitingCount',\n  'queryCount',\n  // Deprecated methods not re-exported from the default pool\n  'queryAsync',\n  'queryOneRowAsync',\n  'queryZeroOrOneRowAsync',\n  'callAsync',\n  'callOneRowAsync',\n  'callZeroOrOneRowAsync',\n]);\n\ndescribe('sqldb', () => {\n  it('exports the full PostgresPool interface', () => {\n    const pool = new PostgresPool();\n\n    Object.getOwnPropertyNames(pool)\n      .filter((n) => !HIDDEN_PROPERTIES.has(n))\n      .forEach((prop) => {\n        assert.property(pgPool, prop);\n        assert.ok((pgPool as any)[prop]);\n      });\n\n    Object.getOwnPropertyNames(Object.getPrototypeOf(pool))\n      .filter((n) => !HIDDEN_PROPERTIES.has(n))\n      .forEach((prop) => {\n        assert.property(pgPool, prop);\n        assert.ok((pgPool as any)[prop]);\n      });\n  });\n\n  it('should not have extra properties', () => {\n    const pool = new PostgresPool();\n\n    const knownProperties = [\n      ...Object.getOwnPropertyNames(pool),\n      ...Object.getOwnPropertyNames(Object.getPrototypeOf(pool)),\n      'PostgresPool',\n    ];\n\n    Object.getOwnPropertyNames(pool).forEach((prop) => {\n      assert.include(knownProperties, prop);\n    });\n  });\n});\n"]}