Skip to content

Commit

Permalink
refactor: tests/integration/310.command.dev.exec.test.cjs (#5886)
Browse files Browse the repository at this point in the history
* refactor: tests/integration/310.command.dev.exec.test.cjs

- replace ava with vitest
- move and rename test file

* Apply suggestions from code review

feat: rename environment variable

Co-authored-by: Lukas Holzer <lukas.holzer@typeflow.cc>

* Apply suggestions from code review

feat: update environment variable

Co-authored-by: Lukas Holzer <lukas.holzer@typeflow.cc>

* Update dev.exec.test.mjs

feat: update environment variable

---------

Co-authored-by: Lukas Holzer <lukas.holzer@typeflow.cc>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Jul 28, 2023
1 parent d8228d8 commit 3678e31
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
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)
})
})

1 comment on commit 3678e31

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📊 Benchmark results

  • Dependency count: 1,303
  • Package size: 271 MB

Please sign in to comment.