Skip to content

Commit

Permalink
Make dockerDirManager tests work with rdctl paths
Browse files Browse the repository at this point in the history
Signed-off-by: Adam Pickering <adam.pickering@suse.com>
  • Loading branch information
adamkpickering committed Jun 20, 2023
1 parent 8ab5238 commit 6ffe607
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/rancher-desktop/utils/__tests__/dockerDirManager.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ describe('DockerDirManager', () => {
});

describe('credHelperWorking', () => {
let resourcesPathMock: jest.SpyInstance<typeof paths.resources, []>;
let replacedPathsResources: jest.ReplaceProperty<string>;
let spawnMock: jest.SpiedFunction<typeof childProcess.spawnFile>;
const commonCredHelperExpectations: (...args: Parameters<typeof childProcess.spawnFile>) => void = (command, args, options) => {
expect(command).toEqual('docker-credential-mockhelper');
Expand All @@ -384,11 +384,11 @@ describe('DockerDirManager', () => {
};

beforeEach(() => {
resourcesPathMock = jest.spyOn(paths, 'resources', 'get').mockReturnValue('RESOURCES');
replacedPathsResources = jest.replaceProperty(paths, 'resources', 'RESOURCES');
});
afterEach(() => {
spawnMock.mockRestore();
resourcesPathMock.mockRestore();
replacedPathsResources.restore();
});

it('should return false when cred helper is not working', async() => {
Expand Down

0 comments on commit 6ffe607

Please sign in to comment.