-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Models only output mode * Update readme * Don't re-create output directory in models only mode
- Loading branch information
Showing
5 changed files
with
157 additions
and
106 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,29 @@ | ||
import * as child_process from "child_process"; | ||
import { readdirSync, statSync } from "fs"; | ||
import path from "path"; | ||
import { isDirectoryNotEmpty } from "../utils"; | ||
|
||
const nexquikMain = "./dist/index.js"; | ||
const testOutputDirectory = path.join( | ||
"__tests__", | ||
"core", | ||
"modelsOnlyTestOutputDirectory" | ||
); | ||
const prismaSchemaDirectory = "prisma"; | ||
const prismaMain = "./node_modules/prisma/build/index.js"; | ||
|
||
test.each(readdirSync(prismaSchemaDirectory))( | ||
`Schema Test: %p`, | ||
(schemaPath: string) => { | ||
child_process.execSync(`rm -rf ${testOutputDirectory}`); | ||
let res = child_process.execSync( | ||
`node ${nexquikMain} -schema ${path.join( | ||
prismaSchemaDirectory, | ||
schemaPath | ||
)} -output ${testOutputDirectory} -modelsOnly` | ||
); | ||
console.log(`Schema Test: ${schemaPath}`); | ||
expect(isDirectoryNotEmpty(testOutputDirectory)).toBeTruthy(); | ||
child_process.execSync(`rm -rf ${testOutputDirectory}`); | ||
} | ||
); |
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