Skip to content

Commit

Permalink
fixup! Add missing var to tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pecigonzalo committed Dec 14, 2023
1 parent 98873d3 commit 345bb79
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions __test__/git-auth-helper.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import * as io from '@actions/io'
import * as os from 'os'
import * as path from 'path'
import * as stateHelper from '../lib/state-helper'
import { IGitCommandManager } from '../lib/git-command-manager'
import { IGitSourceSettings } from '../lib/git-source-settings'
import {IGitCommandManager} from '../lib/git-command-manager'
import {IGitSourceSettings} from '../lib/git-source-settings'

const isWindows = process.platform === 'win32'
const testWorkspace = path.join(__dirname, '_temp', 'git-auth-helper')
Expand All @@ -17,7 +17,7 @@ let localGitConfigPath: string
let globalGitConfigPath: string
let runnerTemp: string
let tempHomedir: string
let git: IGitCommandManager & { env: { [key: string]: string } }
let git: IGitCommandManager & {env: {[key: string]: string}}
let settings: IGitSourceSettings
let sshPath: string
let githubServerUrl: string
Expand All @@ -33,7 +33,7 @@ describe('git-auth-helper tests', () => {

beforeEach(() => {
// Mock setSecret
jest.spyOn(core, 'setSecret').mockImplementation((secret: string) => { })
jest.spyOn(core, 'setSecret').mockImplementation((secret: string) => {})

// Mock error/warning/info/debug
jest.spyOn(core, 'error').mockImplementation(jest.fn())
Expand Down Expand Up @@ -710,17 +710,17 @@ async function setup(testName: string): Promise<void> {
workspace = path.join(testWorkspace, testName, 'workspace')
runnerTemp = path.join(testWorkspace, testName, 'runner-temp')
tempHomedir = path.join(testWorkspace, testName, 'home-dir')
await fs.promises.mkdir(workspace, { recursive: true })
await fs.promises.mkdir(runnerTemp, { recursive: true })
await fs.promises.mkdir(tempHomedir, { recursive: true })
await fs.promises.mkdir(workspace, {recursive: true})
await fs.promises.mkdir(runnerTemp, {recursive: true})
await fs.promises.mkdir(tempHomedir, {recursive: true})
process.env['RUNNER_TEMP'] = runnerTemp
process.env['HOME'] = tempHomedir

// Create git config
globalGitConfigPath = path.join(tempHomedir, '.gitconfig')
await fs.promises.writeFile(globalGitConfigPath, '')
localGitConfigPath = path.join(workspace, '.git', 'config')
await fs.promises.mkdir(path.dirname(localGitConfigPath), { recursive: true })
await fs.promises.mkdir(path.dirname(localGitConfigPath), {recursive: true})
await fs.promises.writeFile(localGitConfigPath, '')

git = {
Expand Down

0 comments on commit 345bb79

Please sign in to comment.