1
0
mirror of https://github.com/sasjs/adapter.git synced 2026-01-14 07:30:05 +00:00

feat(polling-state): improve logging

This commit is contained in:
Yury Shkoda
2021-12-22 18:46:06 +03:00
parent f25d9ec09d
commit 4a963ffbf5
3 changed files with 7 additions and 4 deletions

View File

@@ -9,7 +9,10 @@ import * as isNodeModule from '../../../utils/isNode'
import { PollOptions } from '../../../types'
import { WriteStream } from 'fs'
const baseUrl = 'http://localhost'
const requestClient = new (<jest.Mock<RequestClient>>RequestClient)()
requestClient['httpClient'].defaults.baseURL = baseUrl
const defaultPollOptions: PollOptions = {
maxPollCount: 100,
pollInterval: 500,
@@ -195,7 +198,7 @@ describe('pollJobState', () => {
expect((process as any).logger.info).toHaveBeenCalledTimes(4)
expect((process as any).logger.info).toHaveBeenNthCalledWith(
1,
'Polling: /job/state'
`Polling: ${baseUrl}/job/state`
)
expect((process as any).logger.info).toHaveBeenNthCalledWith(
2,
@@ -203,7 +206,7 @@ describe('pollJobState', () => {
)
expect((process as any).logger.info).toHaveBeenNthCalledWith(
3,
'Polling: /job/state'
`Polling: ${baseUrl}/job/state`
)
expect((process as any).logger.info).toHaveBeenNthCalledWith(
4,