-
Notifications
You must be signed in to change notification settings - Fork 5
Scan components to find asset folders to serve as static resources #22
Scan components to find asset folders to serve as static resources #22
Conversation
Also: - Updates the readme to mention the service_path - Updates the route static tests to use tap, which has a compatible API, but provides better async support than tape - Updates tests
@solidgoldpig setting this as a draft PR since this is my first. Let me know of any feedback! /cc @asmega @theKHutDeveloper for visibility |
Also heads up: the tests were failing for me in master and caused a bunch of confusion as a different branch (the refinement branch) had some fixes...would be good to keep master clean - having a proper PR process, where our PRs are continuously tested for linting errors, tests failures etc. and then rejected if necessary would be a good idea! |
Code review feedback so far:
|
…de-modules-for-asset-folders # Conflicts: # lib/middleware/routes-static/routes-static.test.govuk-frontend.unit.spec.js # lib/middleware/routes-static/routes-static.test.multiple-paths.unit.spec.js # lib/middleware/routes-static/routes-static.test.no-paths.unit.spec.js # lib/middleware/routes-static/routes-static.unit.spec.js # package-lock.json
- Address code review feedback - Remove the serviceDir from route static - Removes uneeded test - Updates package lock file
Hey @solidgoldpig thanks for looking at this! Have pulled in your changes, resolved conflicts, addressed code review feedback and now using Also if you think it's worth doing the ava stuff in this branch, can do that, otherwise will save it for next time |
All good. I think leave the ava-ification for another (but soonish) time The introduction of tap I see has now triggered a bunch of audit warnings. Locally I ran
|
For that particular remaining advisory, fortunately we are immune since the attack vector is from user supplied input. In our case, Also, looking at this: handlebars-lang/handlebars.js#1495 (comment) they have fixed the issue. The version they list as fixed was the same version we had installed, I assume the NPM advisory hasn't been updated to take into account backported fixes. I updated the package lock file anyway though |
Update: Just to be certain, I verified 4.1.0 (which we would have installed):
|
Good to go |
Also:
To expand upon my change of
tape
totap
:tape
didn't have great async support, whereastap
does. While I think there are even better test packages out there, usingtap
is fairly unobtrusive as it has a compatible API, and the test command doesn't even need modifying. All that changes is therequire
statement at the top of the file...we can do this incrementally. Tests can go from:To this:
Which is better IMO.
Also converted the method signature to use objects rather than
function(arg1, arg2, arg3)
etc. As I think it's more readable...ideally though, if we agree, we can add such rules to a linter at some point!