Skip to content

Commit

Permalink
test: tweak up win32 test (#728)
Browse files Browse the repository at this point in the history
* ci: apply env FORCE_COLOR to test only

* test: tweak up win32 test
  • Loading branch information
antongolub authored Feb 25, 2024
1 parent 7e728f6 commit be0d674
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 21 deletions.
1 change: 0 additions & 1 deletion .github/workflows/dev-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 0 additions & 1 deletion .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
38 changes: 19 additions & 19 deletions test/win32.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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!'/)
})
}
})
})

0 comments on commit be0d674

Please sign in to comment.