Skip to content
Snippets Groups Projects
Commit 7c9f2ebb authored by Leander Tolksdorf's avatar Leander Tolksdorf
Browse files

add test: has the database

parent a28014a4
No related branches found
No related tags found
No related merge requests found
import { Client } from "pg";
import { QueryTypes, Sequelize } from "sequelize";
describe("Database Tests", () => {
it("has the database", () => {
const client = new Client({
user: process.env.DB_USER,
host: process.env.DB_HOST,
database: process.env.DB_NAME,
password: process.env.DB_PASSWORD,
});
client.connect();
});
});
const showAllDBs = async (sequelizeConnection: Sequelize) => {
const DBs = await sequelizeConnection.query(
"SELECT datname FROM pg_database",
{ type: QueryTypes.SELECT }
);
console.log(
"----------Found Databases----------\n",
DBs,
"\n-----------------------------------\n"
);
};
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment