From be0d674421db92ea38232cdd81e6d0e4c15e6f50 Mon Sep 17 00:00:00 2001 From: Anton Golub Date: Sun, 25 Feb 2024 21:34:20 +0300 Subject: [PATCH] test: tweak up win32 test (#728) * ci: apply env FORCE_COLOR to test only * test: tweak up win32 test --- .github/workflows/dev-publish.yml | 1 - .github/workflows/npm-publish.yml | 1 - test/win32.test.js | 38 +++++++++++++++---------------- 3 files changed, 19 insertions(+), 21 deletions(-) diff --git a/.github/workflows/dev-publish.yml b/.github/workflows/dev-publish.yml index c243ed46a0..de498d3f95 100644 --- a/.github/workflows/dev-publish.yml +++ b/.github/workflows/dev-publish.yml @@ -18,7 +18,6 @@ jobs: - run: echo "//wombat-dressing-room.appspot.com/:_authToken=$AUTH_TOKEN" >> .npmrc env: AUTH_TOKEN: ${{ secrets.AUTH_TOKEN }} - FORCE_COLOR: 3 - run: | npm version $(node --eval="process.stdout.write(require('./package.json').version)")-dev.$(git rev-parse --short HEAD) --no-git-tag-version npm publish --no-git-tag-version --tag dev diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index b37305f551..d012173c6b 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -19,5 +19,4 @@ jobs: - run: echo "//wombat-dressing-room.appspot.com/:_authToken=$AUTH_TOKEN" >> .npmrc env: AUTH_TOKEN: ${{ secrets.AUTH_TOKEN }} - FORCE_COLOR: 3 - run: npm publish 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!'/) }) - } + }) })