Skip to content

Commit 7e860dc

Browse files
committed
test: update status test on windows
1 parent a772c2a commit 7e860dc

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

test/e2e/commands.spec.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ import type { TestFunction } from 'vitest'
22
import type { commands } from '../../src/commands'
33

44
import { spawnSync } from 'node:child_process'
5-
65
import { fileURLToPath } from 'node:url'
6+
7+
import { isWindows } from 'std-env'
78
import { describe, expect, it } from 'vitest'
89

910
const fixtureDir = fileURLToPath(new URL('../../playground', import.meta.url))
@@ -33,15 +34,15 @@ describe('commands', () => {
3334
const res = spawnSync('pnpm', ['nuxi'], {
3435
cwd: fixtureDir,
3536
})
36-
expect(res.status).toBe(1)
37+
expect(res.status).toBe(isWindows ? null : 1)
3738
expect(res.stderr.toString()).toBe('[error] No command specified.\n')
3839
})
3940

4041
it('throws error if wrong command is provided', async () => {
4142
const res = spawnSync('pnpm', ['nuxi', 'foo'], {
4243
cwd: fixtureDir,
4344
})
44-
expect(res.status).toBe(1)
45+
expect(res.status).toBe(isWindows ? null : 1)
4546
expect(res.stderr.toString()).toBe('[error] Unknown command `foo`\n')
4647
})
4748

0 commit comments

Comments
 (0)