Add validation for post step (#3)

* work on fixing cache post step

* fix tests
This commit is contained in:
Dmitry Shibanov 2021-08-18 05:52:37 +03:00 committed by GitHub
parent 5f3f74c689
commit 53f73ba16b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 31 additions and 4 deletions

View file

@ -1,6 +1,7 @@
import { run as cleanup } from '../src/cleanup-java';
import * as core from '@actions/core';
import * as cache from '@actions/cache';
import * as util from '../src/util';
describe('cleanup', () => {
let spyWarning: jest.SpyInstance<void, Parameters<typeof core.warning>>;
@ -8,10 +9,13 @@ describe('cleanup', () => {
ReturnType<typeof cache.saveCache>,
Parameters<typeof cache.saveCache>
>;
let spyJobStatusSuccess: jest.SpyInstance;
beforeEach(() => {
spyWarning = jest.spyOn(core, 'warning');
spyCacheSave = jest.spyOn(cache, 'saveCache');
spyJobStatusSuccess = jest.spyOn(util, 'isJobStatusSuccess');
spyJobStatusSuccess.mockReturnValue(true);
createStateForSuccessfulRestore();
});
afterEach(() => {