@@ -2,7 +2,7 @@ import * as cache from "@actions/cache";
22import * as core from "@actions/core" ;
33
44import { Events , Inputs , RefKey } from "../src/constants" ;
5- import run from "../src/saveImpl" ;
5+ import { saveImpl } from "../src/saveImpl" ;
66import { StateProvider } from "../src/stateProvider" ;
77import * as actionUtils from "../src/utils/actionUtils" ;
88import * as testUtils from "../src/utils/testUtils" ;
@@ -77,7 +77,7 @@ test("save with invalid event outputs warning", async () => {
7777const invalidEvent = "commit_comment" ;
7878process . env [ Events . Key ] = invalidEvent ;
7979delete process . env [ RefKey ] ;
80- await run ( new StateProvider ( ) ) ;
80+ await saveImpl ( new StateProvider ( ) ) ;
8181expect ( logWarningMock ) . toHaveBeenCalledWith (
8282`Event Validation Error: The event type${ invalidEvent } is not supported because it's not tied to a branch or tag ref.`
8383) ;
@@ -100,7 +100,7 @@ test("save with no primary key in state outputs warning", async () => {
100100} ) ;
101101const saveCacheMock = jest . spyOn ( cache , "saveCache" ) ;
102102
103- await run ( new StateProvider ( ) ) ;
103+ await saveImpl ( new StateProvider ( ) ) ;
104104
105105expect ( saveCacheMock ) . toHaveBeenCalledTimes ( 0 ) ;
106106expect ( logWarningMock ) . toHaveBeenCalledWith ( `Key is not specified.` ) ;
@@ -115,7 +115,7 @@ test("save without AC available should no-op", async () => {
115115
116116const saveCacheMock = jest . spyOn ( cache , "saveCache" ) ;
117117
118- await run ( new StateProvider ( ) ) ;
118+ await saveImpl ( new StateProvider ( ) ) ;
119119
120120expect ( saveCacheMock ) . toHaveBeenCalledTimes ( 0 ) ;
121121} ) ;
@@ -128,7 +128,7 @@ test("save on ghes without AC available should no-op", async () => {
128128
129129const saveCacheMock = jest . spyOn ( cache , "saveCache" ) ;
130130
131- await run ( new StateProvider ( ) ) ;
131+ await saveImpl ( new StateProvider ( ) ) ;
132132
133133expect ( saveCacheMock ) . toHaveBeenCalledTimes ( 0 ) ;
134134} ) ;
@@ -161,7 +161,7 @@ test("save on GHES with AC available", async () => {
161161return Promise . resolve ( cacheId ) ;
162162} ) ;
163163
164- await run ( new StateProvider ( ) ) ;
164+ await saveImpl ( new StateProvider ( ) ) ;
165165
166166expect ( saveCacheMock ) . toHaveBeenCalledTimes ( 1 ) ;
167167expect ( saveCacheMock ) . toHaveBeenCalledWith (
@@ -194,7 +194,7 @@ test("save with exact match returns early", async () => {
194194} ) ;
195195const saveCacheMock = jest . spyOn ( cache , "saveCache" ) ;
196196
197- await run ( new StateProvider ( ) ) ;
197+ await saveImpl ( new StateProvider ( ) ) ;
198198
199199expect ( saveCacheMock ) . toHaveBeenCalledTimes ( 0 ) ;
200200expect ( infoMock ) . toHaveBeenCalledWith (
@@ -221,7 +221,7 @@ test("save with missing input outputs warning", async () => {
221221} ) ;
222222const saveCacheMock = jest . spyOn ( cache , "saveCache" ) ;
223223
224- await run ( new StateProvider ( ) ) ;
224+ await saveImpl ( new StateProvider ( ) ) ;
225225
226226expect ( saveCacheMock ) . toHaveBeenCalledTimes ( 0 ) ;
227227expect ( logWarningMock ) . toHaveBeenCalledWith (
@@ -259,7 +259,7 @@ test("save with large cache outputs warning", async () => {
259259) ;
260260} ) ;
261261
262- await run ( new StateProvider ( ) ) ;
262+ await saveImpl ( new StateProvider ( ) ) ;
263263
264264expect ( saveCacheMock ) . toHaveBeenCalledTimes ( 1 ) ;
265265expect ( saveCacheMock ) . toHaveBeenCalledWith (
@@ -306,7 +306,7 @@ test("save with reserve cache failure outputs warning", async () => {
306306throw error ;
307307} ) ;
308308
309- await run ( new StateProvider ( ) ) ;
309+ await saveImpl ( new StateProvider ( ) ) ;
310310
311311expect ( saveCacheMock ) . toHaveBeenCalledTimes ( 1 ) ;
312312expect ( saveCacheMock ) . toHaveBeenCalledWith (
@@ -349,7 +349,7 @@ test("save with server error outputs warning", async () => {
349349throw new Error ( "HTTP Error Occurred" ) ;
350350} ) ;
351351
352- await run ( new StateProvider ( ) ) ;
352+ await saveImpl ( new StateProvider ( ) ) ;
353353
354354expect ( saveCacheMock ) . toHaveBeenCalledTimes ( 1 ) ;
355355expect ( saveCacheMock ) . toHaveBeenCalledWith (
@@ -392,7 +392,7 @@ test("save with valid inputs uploads a cache", async () => {
392392return Promise . resolve ( cacheId ) ;
393393} ) ;
394394
395- await run ( new StateProvider ( ) ) ;
395+ await saveImpl ( new StateProvider ( ) ) ;
396396
397397expect ( saveCacheMock ) . toHaveBeenCalledTimes ( 1 ) ;
398398expect ( saveCacheMock ) . toHaveBeenCalledWith (