Skip to content

Conversation

fanck0605
Copy link
Contributor

@fanck0605 fanck0605 commented Oct 10, 2021

We need to modify the jest config so that the Less Modules can be tested properly.

https://jestjs.io/docs/webpack#mocking-css-modules

 const jestConfig = {
   moduleNameMapper: {
-    "^.+\\.module\\.(css|sass|scss)$": "identity-obj-proxy",
+    "^.+\\.module\\.(css|less|sass|scss)$": "identity-obj-proxy",
   },
   transformIgnorePatterns: [
-    "^.+\\.module\\.(css|sass|scss)$",
+    "^.+\\.module\\.(css|less|sass|scss)$",
   ],
 };

@fanck0605 fanck0605 force-pushed the jest branch 2 times, most recently from af569e6 to af0e318 Compare October 12, 2021 16:12
@fanck0605 fanck0605 force-pushed the jest branch 2 times, most recently from c308004 to 701fd43 Compare December 18, 2021 05:57
We need to modify the jest config so that the Less Modules can be tested properly.

https://jestjs.io/docs/webpack#mocking-css-modules

```diff
 const jestConfig = {
   moduleNameMapper: {
-    "^.+\\.module\\.(css|sass|scss)$": "identity-obj-proxy",
+    "^.+\\.module\\.(css|less|sass|scss)$": "identity-obj-proxy",
   },
   transformIgnorePatterns: [
-    "^.+\\.module\\.(css|sass|scss)$",
+    "^.+\\.module\\.(css|less|sass|scss)$",
   ],
 };
```
@kamronbatman kamronbatman merged commit 2d4b5ab into DocSpring:master Apr 21, 2022
@fanck0605 fanck0605 deleted the jest branch April 22, 2022 02:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants