-
Notifications
You must be signed in to change notification settings - Fork 57
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
14 changed files
with
63 additions
and
9 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 @@ | ||
import * as child_process from 'child_process'; | ||
|
||
test('nullables.prisma', async () => { | ||
const fileName = 'nullables.svg'; | ||
const folderName = '__tests__'; | ||
child_process.execSync(`rm -f ${folderName}/${fileName}`); | ||
child_process.execSync( | ||
`npx prisma generate --schema ./prisma/nullables.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).toContain(`nullable`); | ||
expect(svgAsString).toContain(`inviteeEmail`); | ||
expect(svgAsString).toContain(`cancelCode`); | ||
expect(svgAsString).toContain(`name`); | ||
}); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 @@ | ||
// 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__/nullables.svg" | ||
} | ||
|
||
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