add ‘renderMethod’ option for runSass()` to support async custom importer - fix #35#148
Open
yoannisj wants to merge 1 commit intooddbird:mainfrom
Open
add ‘renderMethod’ option for runSass()` to support async custom importer - fix #35#148yoannisj wants to merge 1 commit intooddbird:mainfrom
yoannisj wants to merge 1 commit intooddbird:mainfrom
Conversation
Pull Request Test Coverage Report for Build 456
💛 - Coveralls |
jgerigmeyer
requested changes
Jun 20, 2019
Member
jgerigmeyer
left a comment
There was a problem hiding this comment.
Thanks for fleshing out this workaround! I'm glad if it reduces errors and points others in the right direction, but it really feels a bit like a hack without adding full async reporting support to True. I'm on board with a PR documenting this workaround in the meantime, or a PR adding async support -- but I don't personally think this should be merged as-is.
| } | ||
| ); | ||
| }; | ||
| }); |
Member
There was a problem hiding this comment.
This test needs an assertion to be useful.
| "integrity": "sha1-mseNPtXZFYBP2HrLFYvHlxR6Fxk=", | ||
| "dev": true, | ||
| "requires": { | ||
| "node-in |
Member
There was a problem hiding this comment.
This file should be removed from the PR.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR addresses issue #35, where the usage of a custom importer that is relying on the use of sass's async
rendermethod throws a 'doneis not a function' error.The error only gets thrown after the stylesheets get rendered, and sass is done with all the sass-true tests, which mean you'd still get the general stats messages (output by sass-true with
@debug, and listing how many tests were run, how many failed and how many passed).The edits in this PR provide a
renderMethodoption forsassTrue.runSasswhich can be set to 'render', in which case sass'srender()method will be used to run the tests (instead ofrenderSync). This prevents the 'doneis not a function' error to be thrown, but fails to show the detailed report for which tests pass and which don't (as a matter of fact, it shows '0 passed' at the beginning). The@debugstats messages are still shown at the end, and return the correct numbers.I suspect this to be because sass-true doesn't wait for the asynchronous sass rendering to show the results. Maybe this is an easy fix, and you can include it in this PR?
PS: I realise the actual issue here is coming from node-sass, but it seems like it's not going to be solved before they release v5.0.0. In the meantime, I tried to improve the support for custom importers in sass-true, and thought I'd share.