diff --git a/tests/integration/310.command.dev.exec.test.cjs b/tests/integration/310.command.dev.exec.test.cjs deleted file mode 100644 index 56a871ff06e..00000000000 --- a/tests/integration/310.command.dev.exec.test.cjs +++ /dev/null @@ -1,21 +0,0 @@ -const process = require('process') - -const test = require('ava') - -const callCli = require('./utils/call-cli.cjs') -const { withSiteBuilder } = require('./utils/site-builder.cjs') - -test('should pass .env variables to exec command', async (t) => { - await withSiteBuilder('site-env-file', async (builder) => { - builder.withEnvFile({ env: { TEST: 'ENV_VAR' } }) - await builder.buildAsync() - - const cmd = process.platform === 'win32' ? 'set' : 'printenv' - const output = await callCli(['dev:exec', cmd], { - cwd: builder.directory, - }) - - t.is(output.includes('Injected .env file env var: TEST'), true) - t.is(output.includes('TEST=ENV_VAR'), true) - }) -}) diff --git a/tests/integration/commands/dev/dev.exec.test.mjs b/tests/integration/commands/dev/dev.exec.test.mjs new file mode 100644 index 00000000000..43cf1bf7503 --- /dev/null +++ b/tests/integration/commands/dev/dev.exec.test.mjs @@ -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) + }) +})