From 2968ddac8d55a44046f4a39bf01965e7def101c5 Mon Sep 17 00:00:00 2001 From: Ivan Zosimov Date: Fri, 1 Apr 2022 11:51:57 +0200 Subject: [PATCH] Format text of messages in the unit-tests --- __tests__/cache-restore.test.ts | 8 ++++---- __tests__/cache-utils.test.ts | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/__tests__/cache-restore.test.ts b/__tests__/cache-restore.test.ts index 67ce0da..c69abd2 100644 --- a/__tests__/cache-restore.test.ts +++ b/__tests__/cache-restore.test.ts @@ -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(resolve => { - resolve('Some File Hash'); + resolve('file_hash'); }); }); @@ -69,13 +69,13 @@ describe('restoreCache', () => { //Arrange hashFilesSpy.mockImplementation((somePath: string) => { return new Promise(resolve => { - resolve('Some File Hash'); + resolve('file_hash'); }); }); restoreCacheSpy.mockImplementation(() => { return new Promise(resolve => { - resolve('Some cache key'); + resolve('cache_key'); }); }); diff --git a/__tests__/cache-utils.test.ts b/__tests__/cache-utils.test.ts index 422b179..b9c8ff9 100644 --- a/__tests__/cache-utils.test.ts +++ b/__tests__/cache-utils.test.ts @@ -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(resolve => { @@ -35,7 +35,7 @@ describe('getCommandOutput', () => { //Act + Assert expect(async () => { - await cacheUtils.getCommandOutput('some command'); + await cacheUtils.getCommandOutput('command'); }).rejects.toThrow(); }); });