Skip to content

Commit

Permalink
Merge pull request #564 from snyk/chore/fix-test-case
Browse files Browse the repository at this point in the history
chore: fix test case
  • Loading branch information
aarlaud committed Jun 16, 2023
2 parents d4dbc91 + f6e0c59 commit 9ec5afa
Showing 1 changed file with 19 additions and 23 deletions.
42 changes: 19 additions & 23 deletions test/functional/dispatcher-server-api.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,30 +76,26 @@ describe('Broker Server Dispatcher API interaction', () => {
return [200, 'OK'];
});

try {
process.env.DISPATCHER_URL = `${serverUrl}`;
process.env.hostname = '0';
const dispatcher = require('../../lib/dispatcher');
await expect(
dispatcher.clientPinged(
token,
clientId,
clientVersion,
time - fakeLatency,
),
).resolves.not.toThrowError();
expect(spyLogWarn).toHaveBeenCalledTimes(0);
expect(spyFn).toBeCalledWith({
data: {
attributes: {
broker_client_version: '4.144.1',
health_check_link: 'http://0/healthcheck',
},
process.env.DISPATCHER_URL = `${serverUrl}`;
process.env.hostname = '0';
const dispatcher = require('../../lib/dispatcher');
await expect(
dispatcher.clientPinged(
token,
clientId,
clientVersion,
time - fakeLatency,
),
).resolves.not.toThrowError();
expect(spyLogWarn).toHaveBeenCalledTimes(0);
expect(spyFn).toBeCalledWith({
data: {
attributes: {
broker_client_version: '4.144.1',
health_check_link: 'http://0/healthcheck',
},
});
} catch (err) {
expect(err).toBeNull();
}
},
});
});

it('should fire off clientConnected call successfully with warnings', async () => {
Expand Down

0 comments on commit 9ec5afa

Please # to comment.