Skip to content

Instantly share code, notes, and snippets.

@seandearnaley
Created February 1, 2020 23:01
Show Gist options
  • Save seandearnaley/18198a2a2f97b7d6d5546056f20a7c51 to your computer and use it in GitHub Desktop.
Save seandearnaley/18198a2a2f97b7d6d5546056f20a7c51 to your computer and use it in GitHub Desktop.
import { createTestingConnection } from "./index";
module.exports = async (): Promise<void> => {
// code goes here
const connection = await createTestingConnection();
await connection.dropDatabase();
console.log("dropped test db");
await connection.synchronize(true);
console.log("sync test db");
await connection.runMigrations();
console.log("run migrations on test db");
await connection.close();
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment