mirror of
https://github.com/codecov/codecov-action.git
synced 2026-02-09 20:47:26 +00:00
fix: write test for setSafeDirectory
This commit is contained in:
parent
eb61afa559
commit
e9d7aea5fc
1 changed files with 18 additions and 2 deletions
|
|
@ -1,10 +1,13 @@
|
|||
import * as exec from '@actions/exec';
|
||||
|
||||
import {
|
||||
PLATFORMS,
|
||||
getBaseUrl,
|
||||
getCommand,
|
||||
getPlatform,
|
||||
isValidPlatform,
|
||||
isWindows,
|
||||
PLATFORMS,
|
||||
getCommand,
|
||||
setSafeDirectory,
|
||||
} from './helpers';
|
||||
|
||||
let OLDOS = process.env.RUNNER_OS;
|
||||
|
|
@ -78,3 +81,16 @@ test('getCommand', () => {
|
|||
expect(getCommand('path', ['-v', '-x'], 'do-upload'))
|
||||
.toEqual(['path', '-v', '-x', 'do-upload']);
|
||||
});
|
||||
|
||||
test('setSafeDirectory', async () => {
|
||||
process.env.GITHUB_WORKSPACE = 'testOrg/testRepo';
|
||||
await setSafeDirectory();
|
||||
const testSafeDirectory = ([
|
||||
'git',
|
||||
'config',
|
||||
'--get',
|
||||
'safe.directory',
|
||||
]).join(' ');
|
||||
const safeDirectory = await exec.getExecOutput(testSafeDirectory);
|
||||
expect(safeDirectory.stdout).toBe('testOrg/testRepo\n');
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue