-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Trim mmdc from mmdcPath. Added test and documentation for how to…
… utilize new config ption. Resolve tests from nullable and primary key changes.
- Loading branch information
Showing
8 changed files
with
62 additions
and
8 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
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
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,18 @@ | ||
import * as child_process from 'child_process'; | ||
|
||
test('setting mmdcPath works', async () => { | ||
const fileName = 'mmdcPath.svg'; | ||
const folderName = '__tests__'; | ||
child_process.execSync(`rm -f ${folderName}/${fileName}`); | ||
child_process.execSync(`prisma generate --schema ./prisma/mmdcPath.prisma`); | ||
const svgContent = child_process | ||
.execSync(`cat ${folderName}/${fileName}`) | ||
.toString(); | ||
// did the model get added | ||
expect(svgContent).toContain('users'); | ||
|
||
// User has id | ||
expect(svgContent).toMatch( | ||
/id="text-entity-users([^\><]*)-attr-1-name"([^<\>]*)\>id<\/text\>/ | ||
); | ||
}); |
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
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
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,24 @@ | ||
datasource db { | ||
provider = "postgresql" | ||
url = env("DATABASE_URL") | ||
} | ||
|
||
generator erd { | ||
provider = "node ./dist/index.js" | ||
output = "../__tests__/mmdcPath.svg" | ||
theme = "default" | ||
mmdcPath = "node_modules/.bin" | ||
} | ||
|
||
model User { | ||
id Int @id @default(autoincrement()) | ||
createdAt DateTime @default(now()) | ||
updatedAt DateTime @updatedAt | ||
name String | ||
username String @unique | ||
email String @unique | ||
hashedPassword String? @map("hashed_password") | ||
role String @default("user") | ||
@@map("users") | ||
} |
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
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