Skip to content

Commit be0d674

Browse files
authored
test: tweak up win32 test (google#728)
* ci: apply env FORCE_COLOR to test only * test: tweak up win32 test
1 parent 7e728f6 commit be0d674

File tree

3 files changed

+19
-21
lines changed

3 files changed

+19
-21
lines changed

.github/workflows/dev-publish.yml

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ jobs:
1818
- run: echo "//wombat-dressing-room.appspot.com/:_authToken=$AUTH_TOKEN" >> .npmrc
1919
env:
2020
AUTH_TOKEN: ${{ secrets.AUTH_TOKEN }}
21-
FORCE_COLOR: 3
2221
- run: |
2322
npm version $(node --eval="process.stdout.write(require('./package.json').version)")-dev.$(git rev-parse --short HEAD) --no-git-tag-version
2423
npm publish --no-git-tag-version --tag dev

.github/workflows/npm-publish.yml

-1
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,4 @@ jobs:
1919
- run: echo "//wombat-dressing-room.appspot.com/:_authToken=$AUTH_TOKEN" >> .npmrc
2020
env:
2121
AUTH_TOKEN: ${{ secrets.AUTH_TOKEN }}
22-
FORCE_COLOR: 3
2322
- run: npm publish

test/win32.test.js

+19-19
Original file line numberDiff line numberDiff line change
@@ -16,30 +16,30 @@ import assert from 'node:assert'
1616
import { test, describe, beforeEach } from 'node:test'
1717
import '../build/globals.js'
1818

19-
describe('win32', () => {
19+
const _describe = process.platform === 'win32' ? describe : describe.skip
20+
21+
_describe('win32', () => {
2022
beforeEach(() => {
2123
$.verbose = false
2224
})
2325

24-
if (process.platform === 'win32') {
25-
test('should work with windows-specific commands', async () => {
26-
const p = await $`echo $0` // Bash is first by default.
27-
assert.match(p.stdout, /bash/)
28-
await within(async () => {
29-
$.shell = which.sync('powershell.exe')
30-
$.quote = quotePowerShell
31-
const p = await $`get-host`
32-
assert.match(p.stdout, /PowerShell/)
33-
})
26+
test('should work with windows-specific commands', async () => {
27+
const p = await $`echo $0` // Bash is first by default.
28+
assert.match(p.stdout, /bash/)
29+
await within(async () => {
30+
$.shell = which.sync('powershell.exe')
31+
$.quote = quotePowerShell
32+
const p = await $`get-host`
33+
assert.match(p.stdout, /PowerShell/)
3434
})
35+
})
3536

36-
test('quotePowerShell works', async () => {
37-
await within(async () => {
38-
$.shell = which.sync('powershell.exe')
39-
$.quote = quotePowerShell
40-
const p = await $`echo ${`Windows 'rulez!'`}`
41-
assert.match(p.stdout, /Windows 'rulez!'/)
42-
})
37+
test('quotePowerShell works', async () => {
38+
await within(async () => {
39+
$.shell = which.sync('powershell.exe')
40+
$.quote = quotePowerShell
41+
const p = await $`echo ${`Windows 'rulez!'`}`
42+
assert.match(p.stdout, /Windows 'rulez!'/)
4343
})
44-
}
44+
})
4545
})

0 commit comments

Comments
 (0)