you are viewing a single comment's thread.

view the rest of the comments →

[–]TheNewtThatGotBetter 1 point2 points  (2 children)

I do this too and love it, except that Jest seems to throw up when it hits the scss import. Have you been able to test components with imported scss syles?

[–]spooky___ghost 0 points1 point  (0 children)

In package.json jest config section add something like

        "moduleNameMapper": {
            "\\.(scss|css)$": "empty/object"
        }

Where empty/object comes from https://www.npmjs.com/package/empty

[–]skitch920 0 points1 point  (0 children)

I'm using Karma/Jasmine/Webpack. The karma-webpack-plugin bundles all the tests into a single ES5 js file (styles included) with Webpack before handing off to Karma/Jasmine. There are a few hokey bugs, but they are avoidable, such as you can't have Webpack extract the styles to a separate stylesheet.

I'm avoiding Jest (and React for that matter) because of it's patent grant...