-
Notifications
You must be signed in to change notification settings - Fork 54
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
6 changed files
with
99 additions
and
5 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,27 @@ | ||
import * as child_process from 'child_process'; | ||
|
||
test('disableEmoji.prisma', async () => { | ||
const fileName = 'disableEmoji.svg'; | ||
const folderName = '__tests__'; | ||
child_process.execSync(`rm -f ${folderName}/${fileName}`); | ||
child_process.execSync( | ||
`prisma generate --schema ./prisma/disableEmoji.prisma` | ||
); | ||
const listFile = child_process.execSync(`ls -la ${folderName}/${fileName}`); | ||
// did it generate a file | ||
expect(listFile.toString()).toContain(fileName); | ||
|
||
const svgAsString = child_process | ||
.execSync(`cat ${folderName}/${fileName}`) | ||
.toString(); | ||
|
||
// did it generate a file with the correct content | ||
expect(svgAsString).toContain(`<svg`); | ||
expect(svgAsString).not.toContain(`❓`); | ||
expect(svgAsString).not.toContain(`🗝️`); | ||
expect(svgAsString).toContain(`nullable`); | ||
expect(svgAsString).toContain(`PK`); | ||
expect(svgAsString).toContain(`inviteeEmail`); | ||
expect(svgAsString).toContain(`cancelCode`); | ||
expect(svgAsString).toContain(`name`); | ||
}); |
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,29 @@ | ||
// This is your Prisma schema file, | ||
// learn more about it in the docs: https://pris.ly/d/prisma-schema | ||
|
||
datasource db { | ||
provider = "postgresql" | ||
url = env("DATABASE_URL") | ||
} | ||
|
||
generator erd { | ||
provider = "node ./dist/index.js" | ||
output = "../__tests__/disableEmoji.svg" | ||
theme = "forest" | ||
disableEmoji = true | ||
} | ||
|
||
model Booking { | ||
id Int @id @default(autoincrement()) | ||
inviteeEmail String? | ||
startDateUTC DateTime | ||
cancelCode String? | ||
events Event[] | ||
} | ||
|
||
model Event { | ||
id Int @id @default(autoincrement()) | ||
name String? | ||
startDate DateTime | ||
bookings Booking[] | ||
} |
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