Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added a bunch of test for the mix helper. I guess these are really just a bunch of happy path tests, but who doesn't love a happy path?!
I believe the only mix code paths that are now not covered by tests are the when the manifest does exist, but the asset does not. Reason being it hits the global
report
function and gets the config off theapp
helper and the tests felt really brittle making it all work with that. However, I'll do up some additional tests (if this kinda thing is wanted) for5.8
as we should be able to inject the dependencies as mix is now bound to the container in 5.8.I did make changes to the existing test, but only to use the
makeManifest()
helper that I extracted. It still tests the same thing. If you want this reverted let me know.I've made the manifest and hot files match what Laravel Mix actually outputs, for consistency.
When adding json to the manifest we are pretty printing the JSON, as well as not escaping slashes, so instead of...
it will now output what Mix actually outputs....
Also, when Mix is run with
nom run hot
it has a new line, so I've also added the new line, again to stay consistent. I assume that is why when getting the file contentrtrim
is used - to remove that new line.