Skip to content

Conversation

@nathanstitt
Copy link
Contributor

Found one more thing 😁

This makes it a bit easier to mock when testing with Jest, since testing setups have a role saying to mock out '*.css'

I just lost a bit of time debugging why Jest wasn't mocking the css even though I had the recommended rule:

    "moduleNameMapper": {
        "\\.(css|less|scss)$": "<rootDir>/config/styleMock.js"
    }

For now I've changed it to:

    "moduleNameMapper": {
        "\\.(css|less|scss)$": "<rootDir>/config/styleMock.js",
        "flexboxgrid$": "<rootDir>/config/styleMock.js"
   }

which works fine, but would be nicer if I could just use the original rule, especially since the Jest Docs recommend that.

Makes it easier to mock when testing, since testing setups have a role saying to mock out '*.css'
Copy link
Collaborator

@silvenon silvenon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@silvenon silvenon merged commit 8cc6553 into roylee0704:master Feb 27, 2017
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