Skip to content

Commit 820be1c

Browse files
committed
Use netrcFilePath in pull/push command tests so netrc fixtures use _netrc on Windows and .netrc elsewhere, matching netrc-parser
1 parent 72c3243 commit 820be1c

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

test/commands/pull.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {tmpdir} from 'node:os'
77
import {join} from 'node:path'
88

99
import Pull from '../../src/commands/devcenter/pull.js'
10+
import {netrcFilePath} from '../helpers/netrc-path.js'
1011
import {runCommand} from '../helpers/run-command.js'
1112
import {
1213
applyHomeEnv, type HomeEnvSnapshot, setHomeDirForTests, snapshotHomeEnv,
@@ -86,7 +87,7 @@ describe('devcenter:pull', function () {
8687
it('retries with netrc auth when the public JSON request fails', async function () {
8788
const token = 'fake-pull-token'
8889
writeFileSync(
89-
join(noNetrcHome, '.netrc'),
90+
netrcFilePath(noNetrcHome),
9091
`machine api.heroku.com
9192
login t@t.com
9293
password ${token}
@@ -115,7 +116,7 @@ describe('devcenter:pull', function () {
115116
const token = 'fake-pull-token'
116117
const auth = {authorization: `Basic ${Buffer.from(token).toString('base64')}`}
117118
writeFileSync(
118-
join(noNetrcHome, '.netrc'),
119+
netrcFilePath(noNetrcHome),
119120
`machine api.heroku.com
120121
login t@t.com
121122
password ${token}

test/commands/push.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {tmpdir} from 'node:os'
55
import {join} from 'node:path'
66

77
import Push from '../../src/commands/devcenter/push.js'
8+
import {netrcFilePath} from '../helpers/netrc-path.js'
89
import {runCommand} from '../helpers/run-command.js'
910
import {
1011
applyHomeEnv, type HomeEnvSnapshot, setHomeDirForTests, snapshotHomeEnv,
@@ -24,7 +25,7 @@ describe('devcenter:push', function () {
2425
setHomeDirForTests(netrcHome)
2526
process.env.DEVCENTER_CLI_CWD = workDir
2627
writeFileSync(
27-
join(netrcHome, '.netrc'),
28+
netrcFilePath(netrcHome),
2829
`machine api.heroku.com
2930
login test@heroku.com
3031
password fake-api-token-for-tests

0 commit comments

Comments
 (0)