Skip to content
Prev Previous commit
Move WorkItemTrackingRestClient class mock into setupTests
  • Loading branch information
kimsey0 committed Feb 3, 2023
commit ddf9eea5370ee046178c0fd97c032ff1a52b6ebe
Original file line number Diff line number Diff line change
@@ -52,10 +52,6 @@ jest.mock('azure-devops-extension-api/Work/WorkClient', () => {
return { WorkRestClient: workRestClientMock };
});

jest.mock('azure-devops-extension-api/WorkItemTracking/WorkItemTrackingClient', () => ({
WorkItemTrackingRestClient: jest.fn().mockImplementation(() => ({}))
}));

jest.mock('azure-devops-extension-api/Common', () => ({
getClient: (clientClass: typeof Object) => new clientClass(),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this could be moved into __mocks__/azure-devops-extension-api/Common/Common.tsx, but there are some of the other tests that depend on the current behavior.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll make a more overarching issue to maybe get the tests and components tidied eventually - may be a bit of an undertaking. For now, you should be good to go!

}));
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@ jest.mock('azure-devops-extension-api/WorkItemTracking', () => { });
jest.mock('azure-devops-extension-api/WorkItemTracking/WorkItemTracking', () => { });
jest.mock('azure-devops-extension-api/WorkItemTracking/WorkItemTrackingClient', () => {
const mockWorkItemTrackingClient = {
WorkItemTrackingRestClient: {},
WorkItemTrackingRestClient: jest.fn().mockImplementation(() => ({})),
};

return mockWorkItemTrackingClient;