Skip to content

Instantly share code, notes, and snippets.

View a-h-i's full-sized avatar

Ahmed H. Ismail a-h-i

View GitHub Profile
@a-h-i
a-h-i / setup.ts
Created July 7, 2022 11:02 — forked from navjotahuja92/setup.ts
Nest.js Test Setup with In Memory Postgres Database (pg-mem)
// Install npm i pg-mem --save-dev
import { DataSource, Repository } from 'typeorm';
import { newDb, DataType } from 'pg-mem';
import { v4 } from 'uuid';
const setupDataSource = async () => {
const db = newDb({
autoCreateForeignKeyIndices: true,
});
### Keybase proof
I hereby claim:
* I am a-h-i on github.
* I am lpwstr (https://keybase.io/lpwstr) on keybase.
* I have a public key ASAeu9XqvEQXhy7_yyBguy61AWqI220AFLoIfsIn4Lnemwo
To claim this, I am signing this object: