Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
adamjmcgrath committed Sep 8, 2023
1 parent e90012a commit 17b73d5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/management/guardian.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,12 @@ describe('GuardianManager', () => {

await expect(guardian.getSmsFactorTemplates()).resolves.toHaveProperty('data', data);
});

it('should not fail when no response returned', async () => {
nock(API_URL).get('/guardian/factors/sms/templates').reply(204);

await expect(guardian.getSmsFactorTemplates()).resolves.not.toThrow();
});
});

describe('#getFactors', () => {
Expand Down
8 changes: 8 additions & 0 deletions test/management/jobs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,14 @@ describe('JobsManager', () => {
done();
});
});

it('should not fail when no response returned', async () => {
nock.cleanAll();

nock(API_URL).get(`/jobs/${id}/errors`).reply(204);

await expect(jobs.getErrors({ id: id })).resolves.not.toThrow();
});
});

const usersFilePath = path.join(__dirname, '../data/users.json');
Expand Down

0 comments on commit 17b73d5

Please sign in to comment.