Skip to content

Commit

Permalink
test: add a simple test
Browse files Browse the repository at this point in the history
  • Loading branch information
sheremet-va committed Oct 23, 2024
1 parent dc64aa8 commit f6fbc26
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/cli/fixtures/windows-drive-case/basic.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { expect, test } from 'vitest'

test('basic test', () => {
expect(1).toBe(1)
})
19 changes: 19 additions & 0 deletions test/cli/test/windows-drive-case.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { join } from 'pathe'
import { expect, test } from 'vitest'
import { runVitestCli } from '../../test-utils'

const _DRIVE_LETTER_START_RE = /^[A-Z]:\//i
const root = join(import.meta.dirname, '../fixtures/windows-drive-case')
const cwd = root.replace(_DRIVE_LETTER_START_RE, r => r.toLowerCase())

test.runIf(process.platform === 'win32')(`works on windows with a lowercase drive: ${cwd}`, async () => {
const { stderr, stdout } = await runVitestCli({
nodeOptions: {
cwd,
},
}, '--no-watch')

expect(cwd[0]).toEqual(cwd[0].toLowerCase())
expect(stderr).toBe('')
expect(stdout).toContain('1 passed')
})

0 comments on commit f6fbc26

Please sign in to comment.