Luke Childs
dfb944e371
Remove unnecessary empty objects
8 years ago
Luke Childs
ae6b96a4d2
Version lock dependencies
8 years ago
Luke Childs
d4b4f42c25
Swap factory function for wrapper function in reduce callback
Looks simpler and saves a level of indentation
8 years ago
Luke Childs
bf0f3a3958
Inverse if logic for less indentation
8 years ago
Luke Childs
c44e8b013f
Drop standard in favour of xo
8 years ago
Luke Childs
0fefa2eee6
Test useful errors for HTTP response codes
8 years ago
Luke Childs
88fb9715e7
Test HTML responses for errors
8 years ago
Luke Childs
f7622de1db
Extract expire functionality into external module
8 years ago
Luke Childs
c00d6a823e
Only set If-Modified-Since header if we definitely have Last-Modified
8 years ago
Luke Childs
247a0d5cf9
Test last-modified date are sent in headers and handle 304
8 years ago
Luke Childs
72b2d16c6a
Test responses older than max-age are not cached
8 years ago
Luke Childs
8ad93961e2
Test cache can be disabled
8 years ago
Luke Childs
b7e1e47c44
Test responses with future max-age are cached
8 years ago
Luke Childs
3f44ce19aa
Test ":" char isn't url encoded so filters work
8 years ago
Luke Childs
cb5f8e7d25
Test query string is built correctly
8 years ago
Luke Childs
868a67d771
Test passing in custom endpoint
8 years ago
Luke Childs
44f9f292d1
Test endpoint methods return promise
8 years ago
Luke Childs
7fbc9ef673
Test onionoo instance contains endpoint methods
8 years ago
Luke Childs
57b691b665
unit.js -> types.js
8 years ago
Luke Childs
21eef32886
Add test for custom endpoint request
8 years ago
Luke Childs
b16378e39b
Add test for default endpoint request
8 years ago
Luke Childs
4a64b9df50
Only add ? to url if we have a query string
8 years ago
Luke Childs
8d88ff4ef0
Add data fixture
8 years ago
Luke Childs
4689b0882a
Split endpoint tests out into seperate file
8 years ago
Luke Childs
290e877f90
Account for current age in cache calculations
Otherwise 304 responses get thrown off as they have the orig 200 date with the age set
8 years ago
Luke Childs
14f5d7534c
[].indexOf() > -1 -> [].includes()
8 years ago
Luke Childs
b052076359
Refactor caching to be all in the same place
8 years ago
Luke Childs
703b2e7bb3
Make sure got doesn't throw 304s
8 years ago
Luke Childs
f8d73163eb
Send If-Modified-Since header for stale cache entries
8 years ago
Luke Childs
155f078905
Refactor expire function to return expirey date rather than time in ms
8 years ago
Luke Childs
88191ef716
Don't set a ttl on cache entries
8 years ago
Luke Childs
98cbfa3bec
args -> options
8 years ago
Luke Childs
a17b03cf46
Refactor createEndpointMethod to not be wrapped in a promise
8 years ago
Luke Childs
a29cde357c
Only parse JSON on successfull requests
Onionoo returns HTML error pages for bad requests which chokes the JSON parser and means we throw a ParseError when we really want to throw an HTTPError
8 years ago
Luke Childs
edef446641
calculateResponseMaxAge only needs headers as arg
8 years ago
Luke Childs
883e269848
Reformat response to have more useful data
8 years ago
Luke Childs
b6c63d1a38
Set user agent correctly
8 years ago
Luke Childs
6ae31e6845
Calculate max age more reliably
8 years ago
Luke Childs
38b6ee5c7d
checkResponseMaxAge -> calculateResponseMaxAge
8 years ago
Luke Childs
230d6190d0
Test passing in custom endpoint array
8 years ago
Luke Childs
907ade214a
Tweak Onionoo instance object check to follow consistent pattern
8 years ago
Luke Childs
a67ed45cf7
Test Onionoo instance contains expected endpoints
8 years ago
Luke Childs
76dd478420
Test Onionoo instance is an object
8 years ago
Luke Childs
c2af0539e3
Test Onionoo cannot be invoked without 'new'
8 years ago
Luke Childs
bc1362a262
Integrate with Travis and Coveralls
8 years ago
Luke Childs
0ded6a3d31
Add AVA for tests
8 years ago
Luke Childs
6f3e99c9ec
Add snazzy (standard) for linting
8 years ago
Luke Childs
4f6a1bc11a
standard code style
8 years ago
Luke Childs
be667010f0
Swap out node-cache for cache-manager
cache-manager supports multiple storage engines. Now we can ship an in memory cache by default and users can easily disable it or use an alternative storage engine such as Redis by tweaking options.cache
8 years ago
Luke Childs
2509f77fad
Allow cache option to disable cache
8 years ago