[x] Update Makefile to actually run unit tests so they get run on CI
[x] Fix the existing test suite
[ ] Add tests for all files in /src/utils
[ ] db.js
[ ] flags.js
[ ] handlers.js
[x] low-res-image.js
[x] map-key-match.js
[x] navigate.js (this is actually a commented out file so considering it done. Will check if it can be removed)
[x] offline-content.js
[x] parse-link-headers.js
[ ] personal.js
[ ] precache.js
[ ] route.js
[ ] router.js
Note
I have changed the return value for offline-content.js and low-res-image.js. In order for them to just do one thing, as well as to make them easier to test, they no longer return fetch promises they now return a String and a Response object respectively. I have updated their usage here and here.
I still think the stuff we worked on the other day to convert a lot of the tests that weren't same domain to same domain tests needs doing, but one step at a time
Todo:
/src/utils
db.js
flags.js
handlers.js
low-res-image.js
map-key-match.js
navigate.js
(this is actually a commented out file so considering it done. Will check if it can be removed)offline-content.js
parse-link-headers.js
personal.js
precache.js
route.js
[ ]
router.js
Note I have changed the return value for
offline-content.js
andlow-res-image.js
. In order for them to just do one thing, as well as to make them easier to test, they no longer returnfetch
promises they now return a String and a Response object respectively. I have updated their usage here and here.