Skip to content

Commit 6f0d2b5

Browse files
committed
skip unix test on windows
1 parent af5ae8f commit 6f0d2b5

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

packages/core/src/test/shared/env/resolveEnv.test.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import path from 'path'
1010

1111
describe('resolveEnv', async function () {
1212
let sandbox: sinon.SinonSandbox
13+
let originalPlatform = process.platform
1314
beforeEach(function () {
1415
sandbox = sinon.createSandbox()
1516
sandbox.stub(process, 'platform').value('win32')
@@ -53,19 +54,18 @@ describe('resolveEnv', async function () {
5354
})
5455
})
5556

56-
describe('resolveMac', async function () {
57+
describe('resolveUnix', async function () {
5758
const originalEnv = { ...process.env }
58-
beforeEach(function () {
59-
sandbox.stub(process, 'platform').value('darwin')
60-
})
61-
62-
it('mergeResolvedShellPath should get path on mac', async function () {
63-
sandbox.stub(process.env, 'PATH').value('')
64-
// stub the resolve Env logic cause this is platform sensitive.
65-
sandbox.stub(resolveEnv, 'getResolvedShellEnv').resolves(originalEnv)
66-
const env = await testMergeResolveShellPath(process.env)
67-
assert(env.PATH)
68-
assert.notEqual(env, process.env)
69-
})
59+
// skip mac test on windows
60+
if (originalPlatform !== 'win32') {
61+
it('mergeResolvedShellPath should get path on mac/unix', async function () {
62+
sandbox.stub(process.env, 'PATH').value('')
63+
// stub the resolve Env logic cause this is platform sensitive.
64+
sandbox.stub(resolveEnv, 'getResolvedShellEnv').resolves(originalEnv)
65+
const env = await testMergeResolveShellPath(process.env)
66+
assert(env.PATH)
67+
assert.notEqual(env, process.env)
68+
})
69+
}
7070
})
7171
})

0 commit comments

Comments
 (0)