kentcdodds / jest-glamor-react

Jest utilities for Glamor and React
https://npm.im/jest-glamor-react
MIT License
98 stars 24 forks source link

Jest configuration - test environment value #17

Closed megaurav2002 closed 7 years ago

megaurav2002 commented 7 years ago

I was just trying out this but i was struggling to render the css styles in my snapshot. After spending a few hours, i realized i had "testEnvironment": "node" set.

Wondering if this should be a documentation update or a warning that gets shown when the tests are run. I can try to contribute with this.

kentcdodds commented 7 years ago

Hi! Thanks for the issue. Yeah, let's just add a note to the docs. Thanks!

megaurav2002 commented 7 years ago

Thanks @kentcdodds. I just forked this repo and ran "npm start validate" and got an error. Happy to update snapshot but wanted to check if that's ok.

 FAIL  src\custom-sheet.test.js
[test]   ● media queries
[test]
[test]     expect(value).toMatchSnapshot()
[test]
[test]     Received value does not match stored snapshot 1.
[test]
[test]     - Snapshot
[test]     + Received
[test]
[test]     @@ -4,20 +4,8 @@
[test]
[test]      .m-12 {
[test]        margin: 12px;
[test]      }
[test]
[test]     -@media (max-width: 641px) {
[test]     -  ._9gzisy {
[test]     -    font-size: 20px;
[test]     -  }
[test]     -}
[test]     -
[test]     -@media (max-width: 641px) {
[test]     -  ._d2w6i1 {
[test]     -    margin: 10px;
[test]     -  }
[test]     -}
[test]     -
[test]      <div
[test]        className="fs-24 m-12 _9gzisy _d2w6i1"
[test]      />
[test]
[test]       at Object.<anonymous> (src\custom-sheet.test.js:104:18)
kentcdodds commented 7 years ago

Go ahead and update. We'll see if Travis does the same. Thanks!