Skip to content

Commit

Permalink
Fix tests to match new types
Browse files Browse the repository at this point in the history
  • Loading branch information
afharo committed May 13, 2020
1 parent a239142 commit 37f4fac
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/plugins/newsfeed/public/lib/api.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -473,8 +473,8 @@ describe('getApi', () => {
urlRoot: 'http://fakenews.co',
pathTemplate: '/kibana-test/v{VERSION}.json',
},
mainInterval: 86400000,
fetchInterval: 86400000,
mainInterval: moment.duration(86400000),
fetchInterval: moment.duration(86400000),
};
httpMock = ({
fetch: mockHttpGet,
Expand Down Expand Up @@ -623,7 +623,7 @@ describe('getApi', () => {
];

it("retries until fetch doesn't error", done => {
configMock.mainInterval = 10; // fast retry for testing
configMock.mainInterval = moment.duration(10); // fast retry for testing
mockHttpGet
.mockImplementationOnce(() => Promise.reject('Sorry, try again later!'))
.mockImplementationOnce(() => Promise.reject('Sorry, internal server error!'))
Expand Down Expand Up @@ -677,7 +677,7 @@ describe('getApi', () => {
});

it("doesn't retry if fetch succeeds", done => {
configMock.mainInterval = 10; // fast retry for testing
configMock.mainInterval = moment.duration(10); // fast retry for testing
mockHttpGet.mockImplementation(getHttpMockWithItems(successItems));

const timeout$ = interval(1000); // lets us capture some results after a short time
Expand Down

0 comments on commit 37f4fac

Please sign in to comment.