jest-preview
jest-preview copied to clipboard
Add support for configuring Shared Sass Resources for using global mixins, variables, etc.
Summary/ Motivation (TLDR;)
jest-preview currently supports testing JS that imports SASS, but if the SASS files in the main project use variables, mixins, etc, defined in a shared file, the test will not recognize them. This is addressed on the application side with plugins like e.g. sass-resources-loader for webpack. This feature adds similar support to jest-preview.
Related issues
- #297
Features
- Adds a
sharedSassResources
option to the API forjestPreviewConfigure
. This property takes an array of strings with paths to the SASS files that define shared resources (e.g. variables). The paths are relative to the root of the project being tested. The implementation usessass.compileString
to prepend a "use" statement to all imported SASS, referencing a concatenated copy of the shared resources from the jest-preview cache folder. If the project's version of SASS does not support this method, a warning will be logged and the SASS compilation step will fall back to supported methods.
Deploy Preview for jest-preview-library canceled.
Name | Link |
---|---|
Latest commit | bb2dd4a11051f403d280cf29a418ca565f915357 |
Latest deploy log | https://app.netlify.com/sites/jest-preview-library/deploys/64ce2846fff90a0008635ac2 |
Deploy Preview for jest-preview-chinese canceled.
Name | Link |
---|---|
Latest commit | bb2dd4a11051f403d280cf29a418ca565f915357 |
Latest deploy log | https://app.netlify.com/sites/jest-preview-chinese/deploys/64ce28460641c50007b8d8ac |
@ntt261298 I apologize but I have been unable to spend extra time at my computer recently due to some health issues. Thank you for assistance with the CI problems. Let me know if I can clarify anything but would try to get to any further fixes when I can.
@ntt261298 I apologize but I have been unable to spend extra time at my computer recently due to some health issues. Thank you for assistance with the CI problems. Let me know if I can clarify anything but would try to get to any further fixes when I can.
Thanks, @mikeb-meq , just waiting for the final approval from @nvh95 then we can deploy a new version where we have this feature. Thanks for your contribution. I wish you good health.