mirror of
				https://github.com/actions/cache.git
				synced 2025-11-04 13:29:10 +08:00 
			
		
		
		
	Fixed breaking test case
This commit is contained in:
		@@ -15,6 +15,10 @@ beforeAll(() => {
 | 
				
			|||||||
        return jest.requireActual("@actions/core").getInput(name, options);
 | 
					        return jest.requireActual("@actions/core").getInput(name, options);
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    jest.spyOn(core, "getState").mockImplementation(name => {
 | 
				
			||||||
 | 
					        return jest.requireActual("@actions/core").getState(name);
 | 
				
			||||||
 | 
					    });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    jest.spyOn(actionUtils, "getInputAsArray").mockImplementation(
 | 
					    jest.spyOn(actionUtils, "getInputAsArray").mockImplementation(
 | 
				
			||||||
        (name, options) => {
 | 
					        (name, options) => {
 | 
				
			||||||
            return jest
 | 
					            return jest
 | 
				
			||||||
@@ -70,11 +74,11 @@ test("save with valid inputs uploads a cache", async () => {
 | 
				
			|||||||
    jest.spyOn(core, "getState")
 | 
					    jest.spyOn(core, "getState")
 | 
				
			||||||
        // Cache Entry State
 | 
					        // Cache Entry State
 | 
				
			||||||
        .mockImplementationOnce(() => {
 | 
					        .mockImplementationOnce(() => {
 | 
				
			||||||
            return savedCacheKey;
 | 
					            return primaryKey;
 | 
				
			||||||
        })
 | 
					        })
 | 
				
			||||||
        // Cache Key State
 | 
					        // Cache Key State
 | 
				
			||||||
        .mockImplementationOnce(() => {
 | 
					        .mockImplementationOnce(() => {
 | 
				
			||||||
            return primaryKey;
 | 
					            return savedCacheKey;
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    const inputPath = "node_modules";
 | 
					    const inputPath = "node_modules";
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user