-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
4,315 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
node_modules | ||
# Keep environment variables out of version control | ||
.env | ||
__generated__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Setup PostgreSQL server and run following commands. | ||
|
||
``` | ||
$ npm install | ||
$ npm run migrate | ||
$ npm run generate | ||
$ npm run test | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { Prisma, PrismaClient } from "@prisma/client"; | ||
import { PrismaCleaner } from "../../src"; | ||
|
||
export const cleaner = new PrismaCleaner({ | ||
prisma: new PrismaClient(), | ||
models: Prisma.dmmf.datamodel.models, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { cleaner } from "./cleaner"; | ||
|
||
export default async function setup() { | ||
await cleaner.cleanupAllTables(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import type { Config } from "jest"; | ||
|
||
const config: Config = { | ||
moduleFileExtensions: ["js", "json", "ts"], | ||
rootDir: ".", | ||
testEnvironment: "node", | ||
testRegex: ".test.ts$", | ||
transform: { | ||
"^.+\\.ts$": "ts-jest", | ||
}, | ||
maxWorkers: 1, | ||
globalSetup: "<rootDir>/global-setup.ts", | ||
setupFilesAfterEnv: ["<rootDir>/setup.ts"], | ||
}; | ||
|
||
export default config; |
Oops, something went wrong.