Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
npm run format-check
  • Loading branch information
aparnajyothi-y committed Jun 9, 2025
commit b641d7d6ce8655f87a51cc211c1cf5a6b88dcb0e
21 changes: 15 additions & 6 deletions __tests__/setup-python.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ describe('cacheDependencies', () => {
mockedCore.getInput.mockReturnValue('nested/deps.lock');

// Simulate file exists by resolving access without error
mockedFsPromises.access.mockImplementation(async (p) => {
mockedFsPromises.access.mockImplementation(async p => {
const pathStr = typeof p === 'string' ? p : p.toString();
if (pathStr === '/github/action/nested/deps.lock') {
return Promise.resolve();
Expand All @@ -62,11 +62,20 @@ describe('cacheDependencies', () => {
const sourcePath = path.resolve('/github/action', 'nested/deps.lock');
const targetPath = path.resolve('/github/workspace', 'nested/deps.lock');

expect(mockedFsPromises.access).toHaveBeenCalledWith(sourcePath, fs.constants.F_OK);
expect(mockedFsPromises.mkdir).toHaveBeenCalledWith(path.dirname(targetPath), {
recursive: true
});
expect(mockedFsPromises.copyFile).toHaveBeenCalledWith(sourcePath, targetPath);
expect(mockedFsPromises.access).toHaveBeenCalledWith(
sourcePath,
fs.constants.F_OK
);
expect(mockedFsPromises.mkdir).toHaveBeenCalledWith(
path.dirname(targetPath),
{
recursive: true
}
);
expect(mockedFsPromises.copyFile).toHaveBeenCalledWith(
sourcePath,
targetPath
);
expect(mockedCore.info).toHaveBeenCalledWith(
`Copied ${sourcePath} to ${targetPath}`
);
Expand Down
Loading