-
Notifications
You must be signed in to change notification settings - Fork 406
Be/feature/ri 5741 rdi unit tests #3591
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
}, | ||
{ | ||
provide: RdiClientStorage, | ||
useFactory: jest.fn(() => ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's move this factory to mocks the same way as we do everywhere
}, | ||
{ | ||
provide: RdiClientFactory, | ||
useFactory: jest.fn(() => ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the same
message: result.message, | ||
statusCode: HttpStatus.NOT_FOUND, | ||
error: 'RdiNotFound', | ||
errorCode: CustomErrorCodes.ConvAiNotFound, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ConvAI error on RDI? Could you, please fix it in code.
transformations: { | ||
status: RdiDyRunJobStatus.Success, | ||
// data: {}, | ||
// error: '' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comments?
}, | ||
{ | ||
provide: RdiPipelineAnalytics, | ||
useValue: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you please move this to mocks the same way as here useFactory: mockRdiClientProvider,
?
|
||
describe('dryRunJob', () => { | ||
it('should call getOrCreate on rdiClientProvider with the correct metadata', async () => { | ||
const client = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will work but is it better to create single mockedClient (which already exists as I remember) and use mockClient.someMethod.mockResolvedValueOnce
everywhere without mocking everything inside tests
}, | ||
{ | ||
provide: RdiAnalytics, | ||
useValue: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move to mocks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm
The base branch was changed.
No description provided.