From 0f62839aa043ca52c07672e97b4e8585effe4c67 Mon Sep 17 00:00:00 2001 From: Anton Golub Date: Sun, 25 Feb 2024 21:01:48 +0300 Subject: [PATCH] test: tweak up win32 test --- test/win32.test.js | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/test/win32.test.js b/test/win32.test.js index 9f322c99a3..7c63de9a71 100644 --- a/test/win32.test.js +++ b/test/win32.test.js @@ -16,30 +16,30 @@ import assert from 'node:assert' import { test, describe, beforeEach } from 'node:test' import '../build/globals.js' -describe('win32', () => { +const _describe = process.platform === 'win32' ? describe : describe.skip + +_describe('win32', () => { beforeEach(() => { $.verbose = false }) - if (process.platform === 'win32') { - test('should work with windows-specific commands', async () => { - const p = await $`echo $0` // Bash is first by default. - assert.match(p.stdout, /bash/) - await within(async () => { - $.shell = which.sync('powershell.exe') - $.quote = quotePowerShell - const p = await $`get-host` - assert.match(p.stdout, /PowerShell/) - }) + test('should work with windows-specific commands', async () => { + const p = await $`echo $0` // Bash is first by default. + assert.match(p.stdout, /bash/) + await within(async () => { + $.shell = which.sync('powershell.exe') + $.quote = quotePowerShell + const p = await $`get-host` + assert.match(p.stdout, /PowerShell/) }) + }) - test('quotePowerShell works', async () => { - await within(async () => { - $.shell = which.sync('powershell.exe') - $.quote = quotePowerShell - const p = await $`echo ${`Windows 'rulez!'`}` - assert.match(p.stdout, /Windows 'rulez!'/) - }) + test('quotePowerShell works', async () => { + await within(async () => { + $.shell = which.sync('powershell.exe') + $.quote = quotePowerShell + const p = await $`echo ${`Windows 'rulez!'`}` + assert.match(p.stdout, /Windows 'rulez!'/) }) - } + }) })