Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: tests/integration/310.command.dev.exec.test.cjs #5886

21 changes: 0 additions & 21 deletions tests/integration/310.command.dev.exec.test.cjs

This file was deleted.

21 changes: 21 additions & 0 deletions tests/integration/commands/dev/dev.exec.test.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import process from 'process'

import { test } from 'vitest'

import callCli from '../../utils/call-cli.cjs'
import { withSiteBuilder } from '../../utils/site-builder.cjs'

test('should pass .env variables to exec command', async (t) => {
await withSiteBuilder('site-env-file', async (builder) => {
builder.withEnvFile({ env: { MY_SUPER_SECRET: 'SECRET' } })
await builder.buildAsync()

const cmd = process.platform === 'win32' ? 'set' : 'printenv'
const output = await callCli(['dev:exec', cmd], {
cwd: builder.directory,
})

t.expect(output.includes('Injected .env file env var: MY_SUPER_SECRET')).toBe(true)
t.expect(output.includes('MY_SUPER_SECRET=SECRET')).toBe(true)
})
})
Loading