(env: Record<string, string>, envFilename = '.env.development')
| 5 | import { ValidateEnv as CoreTypedValidateEnv } from '../src/index.ts' |
| 6 | |
| 7 | export async function createEnvFile(env: Record<string, string>, envFilename = '.env.development') { |
| 8 | const test = getActiveTest() |
| 9 | if (!test) throw new Error('No active test found') |
| 10 | |
| 11 | const content = Object.entries(env) |
| 12 | .map(([key, value]) => `${key}=${value}`) |
| 13 | .join('\n') |
| 14 | |
| 15 | await test.context.fs.create(envFilename, content) |
| 16 | } |
| 17 | |
| 18 | export async function executeValidateEnv(plugin: Plugin<any>, config?: UserConfig) { |
| 19 | const test = getActiveTest() |
no outgoing calls
no test coverage detected