Skip to content

Commit

Permalink
Cleanup tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jaherne-duo committed Jan 10, 2024
1 parent e471b9f commit 3c66d6d
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions tests/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ describe('Verifying rate limited request retries', function () {
rateLimitedScope.on('replied', function (req, interceptor) {
clock.tick(currentWaitSecs + MAX_RANDOM_OFFSET)
})
console.log('added emitter')
})

it('verify all rate limited responses', function (done) {
Expand Down Expand Up @@ -115,11 +114,9 @@ describe('Signature Checks', function () {
var scope = setupNock(requestHeaders)
scope.get(/.*/)
.reply(200, {'response': {foo: 'bar'}, stat: 'OK'})
.log(console.log)

var client = new duo_api.Client(IKEY, SKEY, API_HOSTNAME)
client.jsonApiCall('GET', '/foo/bar', params, function (resp) {
console.log(resp)
assert.equal(resp.stat, 'OK')
done()
})
Expand All @@ -139,11 +136,9 @@ describe('Signature Checks', function () {
var scope = setupNock(requestHeaders)
scope.post(/.*/)
.reply(200, {'response': {foo: 'bar'}, stat: 'OK'})
.log(console.log)

var client = new duo_api.Client(IKEY, SKEY, API_HOSTNAME)
client.jsonApiCall('POST', '/foo/bar', params, function (resp) {
console.log(resp)
assert.equal(resp.stat, 'OK')
done()
})
Expand All @@ -163,11 +158,9 @@ describe('Signature Checks', function () {
var scope = setupNock(requestHeaders)
scope.get(/.*/)
.reply(200, {'response': {foo: 'bar'}, stat: 'OK'})
.log(console.log)

var client = new duo_api.Client(IKEY, SKEY, API_HOSTNAME, duo_api.SIG_VERSION_5)
var client = new duo_api.Client(IKEY, SKEY, API_HOSTNAME, duo_api.SIGNATURE_VERSION_5)
client.jsonApiCall('GET', '/foo/bar', params, function (resp) {
console.log(resp)
assert.equal(resp.stat, 'OK')
done()
})
Expand All @@ -182,17 +175,15 @@ describe('Signature Checks', function () {
var requestHeaders = {
'Date': date,
'Host': API_HOSTNAME,
//'Authorization': sig,
'Authorization': sig,
'Content-type': 'application/json'
}
var scope = setupNock(requestHeaders)
scope.post(/.*/)
.reply(200, {'response': {foo: 'bar'}, stat: 'OK'})
.log(console.log)

var client = new duo_api.Client(IKEY, SKEY, API_HOSTNAME, duo_api.SIG_VERSION_5)
var client = new duo_api.Client(IKEY, SKEY, API_HOSTNAME, duo_api.SIGNATURE_VERSION_5)
client.jsonApiCall('POST', '/foo/bar', params, function (resp) {
console.log(resp)
assert.equal(resp.stat, 'OK')
done()
})
Expand Down

0 comments on commit 3c66d6d

Please sign in to comment.