Skip to content

Commit

Permalink
refactor /tests/integration/660.command.dev.geo.test.cjs (#5918)
Browse files Browse the repository at this point in the history
* refactor: move and rename test file

* refactor: convert file to esm

- convert file from cjs to esm
- adjust code accordingly

* refactor: replace ava with vitest

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
hereje and kodiakhq[bot] authored Aug 2, 2023
1 parent 7a6bbd6 commit f503059
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 22 deletions.
22 changes: 0 additions & 22 deletions tests/integration/660.command.dev.geo.test.cjs

This file was deleted.

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

import { test } from 'vitest'

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

test('should throw if invalid country arg is passed', async (t) => {
await withSiteBuilder('site-env', async (builder) => {
await builder.buildAsync()

const options = {
cwd: builder.directory,
extendEnv: false,
PATH: process.env.PATH,
}

const errors = await Promise.allSettled([
callCli(['dev', '--geo=mock', '--country=a1'], options),
callCli(['dev', '--geo=mock', '--country=NotARealCountryCode'], options),
callCli(['dev', '--geo=mock', '--country='], options),
])

errors.forEach((error) => {
t.expect(error.status).toEqual('rejected')
})
})
})

1 comment on commit f503059

@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.