mirror of
https://github.com/actions/setup-go.git
synced 2025-04-24 01:50:52 +00:00
Format text of messages in the unit-tests
This commit is contained in:
parent
104f9bb034
commit
2968ddac8d
2 changed files with 8 additions and 8 deletions
|
@ -18,7 +18,7 @@ describe('restoreCache', () => {
|
|||
let setOutputSpy = jest.spyOn(core, 'setOutput');
|
||||
|
||||
const packageManager = 'default';
|
||||
const cacheDependencyPath = 'some path';
|
||||
const cacheDependencyPath = 'path';
|
||||
|
||||
beforeEach(() => {
|
||||
getCacheDirectoryPathSpy.mockImplementation(
|
||||
|
@ -50,7 +50,7 @@ describe('restoreCache', () => {
|
|||
//Arrange
|
||||
hashFilesSpy.mockImplementation((somePath: string) => {
|
||||
return new Promise<string>(resolve => {
|
||||
resolve('Some File Hash');
|
||||
resolve('file_hash');
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -69,13 +69,13 @@ describe('restoreCache', () => {
|
|||
//Arrange
|
||||
hashFilesSpy.mockImplementation((somePath: string) => {
|
||||
return new Promise<string>(resolve => {
|
||||
resolve('Some File Hash');
|
||||
resolve('file_hash');
|
||||
});
|
||||
});
|
||||
|
||||
restoreCacheSpy.mockImplementation(() => {
|
||||
return new Promise<string>(resolve => {
|
||||
resolve('Some cache key');
|
||||
resolve('cache_key');
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ describe('getCommandOutput', () => {
|
|||
|
||||
it('should return trimmed stdout in case of successful exit code', async () => {
|
||||
//Arrange
|
||||
const stdoutResult = ' some stdout ';
|
||||
const stdoutResult = ' stdout ';
|
||||
const trimmedStdout = stdoutResult.trim();
|
||||
|
||||
getExecOutputSpy.mockImplementation((commandLine: string) => {
|
||||
|
@ -19,13 +19,13 @@ describe('getCommandOutput', () => {
|
|||
|
||||
//Act + Assert
|
||||
return cacheUtils
|
||||
.getCommandOutput('some command')
|
||||
.getCommandOutput('command')
|
||||
.then(data => expect(data).toBe(trimmedStdout));
|
||||
});
|
||||
|
||||
it('should return error in case of unsuccessful exit code', async () => {
|
||||
//Arrange
|
||||
const stderrResult = 'Some error message';
|
||||
const stderrResult = 'error message';
|
||||
|
||||
getExecOutputSpy.mockImplementation((commandLine: string) => {
|
||||
return new Promise<exec.ExecOutput>(resolve => {
|
||||
|
@ -35,7 +35,7 @@ describe('getCommandOutput', () => {
|
|||
|
||||
//Act + Assert
|
||||
expect(async () => {
|
||||
await cacheUtils.getCommandOutput('some command');
|
||||
await cacheUtils.getCommandOutput('command');
|
||||
}).rejects.toThrow();
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue