(projectDir: string)
| 69 | } |
| 70 | |
| 71 | async function installAndBuild(projectDir: string): Promise<void> { |
| 72 | // Install dependencies |
| 73 | childProcess.execSync(`npm i`, {cwd: projectDir}); |
| 74 | |
| 75 | // NODE_ENV should be "test" we need to create an env file for it |
| 76 | const envFile = path.join(projectDir, '.env'); |
| 77 | if (fs.existsSync(envFile)) { |
| 78 | await fs.promises.copyFile(envFile, path.join(projectDir, `.env.${process.env.NODE_ENV}`)); |
| 79 | } |
| 80 | |
| 81 | await Codegen.run([projectDir]); |
| 82 | await Build.run([projectDir]); |
| 83 | } |
| 84 | |
| 85 | export async function createTestProject(): Promise<string> { |
| 86 | const tmpdir = await fs.promises.mkdtemp(`${os.tmpdir()}${path.sep}`); |
no test coverage detected