Skip to content

Commit

Permalink
Ensure only the properties we expect are there
Browse files Browse the repository at this point in the history
  • Loading branch information
nicjansma committed Feb 17, 2017
1 parent d9e8c3d commit a9ad38a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/test-timing.js
Expand Up @@ -44,6 +44,17 @@ tape('non-redirected request is timed', function(t) {
t.equal((res.timings.firstByte > 0), true)
t.equal((res.timings.download > 0), true)
t.equal((res.timings.total > 0), true)

// validate there are no unexpected properties
var propNames = []
for (var propName in res.timings) {
if (res.timings.hasOwnProperty(propName)) {
propNames.push(propName)
}
}
t.deepEqual(propNames, ['start', 'socket', 'connect', 'response', 'end', 'dns',
'tcp', 'firstByte', 'download', 'total'])

t.end()
})
})
Expand Down

0 comments on commit a9ad38a

Please sign in to comment.