MCPcopy Create free account
hub / github.com/Julien-R44/vite-plugin-validate-env / createEnvFile

Function createEnvFile

tests/helpers.ts:7–16  ·  view source on GitHub ↗
(env: Record<string, string>, envFilename = '.env.development')

Source from the content-addressed store, hash-verified

5import { ValidateEnv as CoreTypedValidateEnv } from '../src/index.ts'
6
7export 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
18export async function executeValidateEnv(plugin: Plugin<any>, config?: UserConfig) {
19 const test = getActiveTest()

Callers 3

config.spec.tsFile · 0.90
standard.spec.tsFile · 0.90
common.spec.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected