test/end-to-end: implement caching of npm packages

Speed up subsequent runs of unit-tests by caching the result of
`npm install`.