Skip to content

Commit

Permalink
test: remove test
Browse files Browse the repository at this point in the history
  • Loading branch information
ozum committed Dec 7, 2021
1 parent 2d13861 commit 3d5b76e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,7 @@ function addObjects(db: Db, queryResults: QueryResults): void {
* @returns whether given input are options for the `pgStructure` function.
*/
function isOptions(input?: Client | ClientConfig | string | Options): input is Options {
/* istanbul ignore next */
if (input === undefined) return false;
const optionsAvailable: Required<{ [K in keyof Options]: true }> = {
envPrefix: true,
Expand Down Expand Up @@ -439,6 +440,7 @@ export async function pgStructure(client?: Client | ClientConfig | string, optio
export async function pgStructure(options?: Options): Promise<Db>;
export async function pgStructure(clientOrOptions?: Client | ClientConfig | string | Options, maybeOptions: Options = {}): Promise<Db> {
const [maybePgClientOrConfig, options] = isOptions(clientOrOptions) ? [undefined, clientOrOptions] : [clientOrOptions, maybeOptions];
/* istanbul ignore next */
const pgClientOrConfig = maybePgClientOrConfig ?? getEnvValues(options.envPrefix ?? "DB");
const { client, shouldCloseConnection } = await getConnectedPgClient(pgClientOrConfig);

Expand Down
4 changes: 0 additions & 4 deletions test/pg-structure.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,6 @@ describe("pgStructure()", () => {
expect(db.tables.get("account").name).toEqual("account");
});

it("should throw if it cannot connect.", async () => {
await expect(pgStructure()).rejects.toThrow();
});

it("should accept options as first argument and reads client config from environment variables.", async () => {
process.env.DBPX_USER = "xyz-user";
process.env.DBPX_PASSWORD = "wrong-password";
Expand Down

0 comments on commit 3d5b76e

Please sign in to comment.