The tests for this app were failing after GOV.UK's assets switched from
the assets hostname to www. This was because slimmer was actually
embedding links to production GOV.UK assets which were symlinked to the
latest ones. Once the assets changed path then the tests broke.
Since it is good practice for tests to be isolated I've created a
test-dependencies.js file which loads in the basic slimmer dependencies
from govuk_publishing_components. This has the advantage that this test
suite no longer has external network requirement, but does have the
disadvantage that the JS isn't the same. This trade-off seems reasonable
since there was never anything particularly realistic about the slimmer
test template 1 and it's mostly luck that it matches production.
Trello: https://trello.com/c/oNEtjIVp/99-serve-static-assets-from-www-hostname
The tests for this app were failing after GOV.UK's assets switched from the assets hostname to www. This was because slimmer was actually embedding links to production GOV.UK assets which were symlinked to the latest ones. Once the assets changed path then the tests broke.
Since it is good practice for tests to be isolated I've created a test-dependencies.js file which loads in the basic slimmer dependencies from govuk_publishing_components. This has the advantage that this test suite no longer has external network requirement, but does have the disadvantage that the JS isn't the same. This trade-off seems reasonable since there was never anything particularly realistic about the slimmer test template 1 and it's mostly luck that it matches production.