File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -142,6 +142,20 @@ Sass's support for the legacy JavaScript API has the following limitations:
142
142
[ `precision` ] : https://github.com/sass/node-sass#precision
143
143
[ `sourceComments` ] : https://github.com/sass/node-sass#sourcecomments
144
144
145
+ #### Using Sass with Jest
146
+
147
+ If you're using [ Jest] to run your tests, be aware that it has a [ longstanding
148
+ bug] where its default test environment breaks JavaScript's built-in
149
+ [ ` instanceof ` operator] . Dart Sass's JS package uses ` instanceof ` fairly
150
+ heavily, so in order to avoid breaking Sass you'll need to install
151
+ [ ` jest-environment-node-single-context ` ] and add `testEnvironment:
152
+ 'jest-environment-node-single-context'` to your Jest config.
153
+
154
+ [ Jest ] : https://jestjs.io/
155
+ [ longstanding bug ] : https://github.com/facebook/jest/issues/2549
156
+ [ `instanceof` operator ] : https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/instanceof
157
+ [ `jest-environment-node-single-context` ] : https://www.npmjs.com/package/jest-environment-node-single-context
158
+
145
159
### From Pub
146
160
147
161
If you're a Dart user, you can install Dart Sass globally using `pub global
You can’t perform that action at this time.
0 commit comments