@@ -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 () => {
7777 const invalidEvent = "commit_comment" ;
7878 process . env [ Events . Key ] = invalidEvent ;
7979 delete process . env [ RefKey ] ;
80- await run ( new StateProvider ( ) ) ;
80+ await saveImpl ( new StateProvider ( ) ) ;
8181 expect ( 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 } ) ;
101101 const saveCacheMock = jest . spyOn ( cache , "saveCache" ) ;
102102
103- await run ( new StateProvider ( ) ) ;
103+ await saveImpl ( new StateProvider ( ) ) ;
104104
105105 expect ( saveCacheMock ) . toHaveBeenCalledTimes ( 0 ) ;
106106 expect ( logWarningMock ) . toHaveBeenCalledWith ( `Key is not specified.` ) ;
@@ -115,7 +115,7 @@ test("save without AC available should no-op", async () => {
115115
116116 const saveCacheMock = jest . spyOn ( cache , "saveCache" ) ;
117117
118- await run ( new StateProvider ( ) ) ;
118+ await saveImpl ( new StateProvider ( ) ) ;
119119
120120 expect ( saveCacheMock ) . toHaveBeenCalledTimes ( 0 ) ;
121121} ) ;
@@ -128,7 +128,7 @@ test("save on ghes without AC available should no-op", async () => {
128128
129129 const saveCacheMock = jest . spyOn ( cache , "saveCache" ) ;
130130
131- await run ( new StateProvider ( ) ) ;
131+ await saveImpl ( new StateProvider ( ) ) ;
132132
133133 expect ( saveCacheMock ) . toHaveBeenCalledTimes ( 0 ) ;
134134} ) ;
@@ -161,7 +161,7 @@ test("save on GHES with AC available", async () => {
161161 return Promise . resolve ( cacheId ) ;
162162 } ) ;
163163
164- await run ( new StateProvider ( ) ) ;
164+ await saveImpl ( new StateProvider ( ) ) ;
165165
166166 expect ( saveCacheMock ) . toHaveBeenCalledTimes ( 1 ) ;
167167 expect ( saveCacheMock ) . toHaveBeenCalledWith (
@@ -194,7 +194,7 @@ test("save with exact match returns early", async () => {
194194 } ) ;
195195 const saveCacheMock = jest . spyOn ( cache , "saveCache" ) ;
196196
197- await run ( new StateProvider ( ) ) ;
197+ await saveImpl ( new StateProvider ( ) ) ;
198198
199199 expect ( saveCacheMock ) . toHaveBeenCalledTimes ( 0 ) ;
200200 expect ( infoMock ) . toHaveBeenCalledWith (
@@ -221,7 +221,7 @@ test("save with missing input outputs warning", async () => {
221221 } ) ;
222222 const saveCacheMock = jest . spyOn ( cache , "saveCache" ) ;
223223
224- await run ( new StateProvider ( ) ) ;
224+ await saveImpl ( new StateProvider ( ) ) ;
225225
226226 expect ( saveCacheMock ) . toHaveBeenCalledTimes ( 0 ) ;
227227 expect ( 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
264264 expect ( saveCacheMock ) . toHaveBeenCalledTimes ( 1 ) ;
265265 expect ( saveCacheMock ) . toHaveBeenCalledWith (
@@ -306,7 +306,7 @@ test("save with reserve cache failure outputs warning", async () => {
306306 throw error ;
307307 } ) ;
308308
309- await run ( new StateProvider ( ) ) ;
309+ await saveImpl ( new StateProvider ( ) ) ;
310310
311311 expect ( saveCacheMock ) . toHaveBeenCalledTimes ( 1 ) ;
312312 expect ( saveCacheMock ) . toHaveBeenCalledWith (
@@ -349,7 +349,7 @@ test("save with server error outputs warning", async () => {
349349 throw new Error ( "HTTP Error Occurred" ) ;
350350 } ) ;
351351
352- await run ( new StateProvider ( ) ) ;
352+ await saveImpl ( new StateProvider ( ) ) ;
353353
354354 expect ( saveCacheMock ) . toHaveBeenCalledTimes ( 1 ) ;
355355 expect ( saveCacheMock ) . toHaveBeenCalledWith (
@@ -392,7 +392,7 @@ test("save with valid inputs uploads a cache", async () => {
392392 return Promise . resolve ( cacheId ) ;
393393 } ) ;
394394
395- await run ( new StateProvider ( ) ) ;
395+ await saveImpl ( new StateProvider ( ) ) ;
396396
397397 expect ( saveCacheMock ) . toHaveBeenCalledTimes ( 1 ) ;
398398 expect ( saveCacheMock ) . toHaveBeenCalledWith (
0 commit comments