Skip to content

Commit

Permalink
test: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alexey-yarmosh committed Nov 22, 2023
1 parent 1b5a765 commit 6e46b16
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions test/tests/unit/adopted-probes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const defaultConnectedProbe: Probe = {
const selectStub = sinon.stub();
const updateStub = sinon.stub();
const deleteStub = sinon.stub();
const insertStub = sinon.stub();
const rawStub = sinon.stub();
const whereStub = sinon.stub().returns({
update: updateStub,
delete: deleteStub,
Expand All @@ -70,8 +70,8 @@ const joinStub = sinon.stub().returns({
const sqlStub = sinon.stub().returns({
join: joinStub,
where: whereStub,
insert: insertStub,
});
}) as sinon.SinonStub<any[], any> & {raw: any};
sqlStub.raw = rawStub;
const fetchSocketsStub = sinon.stub().resolves([]);
let sandbox: sinon.SinonSandbox;

Expand Down Expand Up @@ -280,13 +280,13 @@ describe('AdoptedProbes', () => {

await adoptedProbes.syncDashboardData();

expect(insertStub.callCount).to.equal(1);
expect(rawStub.callCount).to.equal(1);

expect(insertStub.args[0]).to.deep.equal([{
expect(rawStub.args[0][1]).to.deep.equal({

Check failure on line 285 in test/tests/unit/adopted-probes.test.ts

View workflow job for this annotation

GitHub Actions / build

Object is possibly 'undefined'.
recipient: '3cff97ae-4a0a-4f34-9f1a-155e6def0a45',
subject: 'Adopted probe country change',
message: 'Globalping API detected that your adopted probe with ip: 1.1.1.1 is located at "GB". So its country value changed from "IE" to "GB", and previous custom city value "Dublin" is not applied right now.\n\nIf this change is not right please report in [that issue](https://github.com/jsdelivr/globalping/issues/268).',
}]);
message: 'Globalping API detected that your adopted probe with ip: 1.1.1.1 is located at "GB". So its country value changed from "IE" to "GB", and custom city value "Dublin" is not applied right now.\n\nIf this change is not right please report in [that issue](https://github.com/jsdelivr/globalping/issues/268).',
});

expect(whereStub.callCount).to.equal(1);
expect(whereStub.args[0]).to.deep.equal([{ ip: '1.1.1.1' }]);
Expand Down

0 comments on commit 6e46b16

Please sign in to comment.