Last 12 weeks · 0 commits
5 of 6 standards met
version: 4.3.1 version: 8.11.2 (or ) version: yarn 1.7.0 https://github.com/pbomb/null-after-snaphot What you did: Wrote simple component and test using react-testing-library. Asserting snapshot using: What happened: After this line executes, for some reason container.firstChild becomes . It's not before the snapshot is compared. This causes errors to be output when running from react-testing-library after each test because React complains that the DOM node we're trying to unmount doesn't seem to have the expected children. Reproduction repository: https://github.com/pbomb/null-after-snaphot Problem description: It seems that something within jest / jsdom / jest-glamor-react is setting the DOM node to null somehow. Suggested solution: Not really sure, unfortunately what the root cause is. I don't really even understand how the object's property is getting set to .
version: 4.3.1 version: 9.11.2 (or ) version: 6.1.0 What you did: I have two repositories, one that contains a UI library using glamour and the other that contains our production site, also using glamor. Both are using the same version of jest-glamor-react. In our main repo, when we have the UI library installed normally, we see the styles come through on all components, and all is well. But when running npm link to symlink to a local copy of the UI library, components from that library no longer get transformed, and we just get data-css-hash in our snapshots for those components. Reproduction repository: https://github.com/chrissinclairedited/jest-glamor-react-issue-library https://github.com/chrissinclairedited/jest-glamor-react-issue-client Clone both and link client -> library (the dependency in client is expecting it to be called library) and the tests pass. But looking at the snapshots for the client, the test that depends on the library component doesn't include the styles. Problem description: Snapshots are not transforming css classes when the component exists in a locally linked repo. Suggested solution: Treat locally linked libraries the same way as locally installed ones and transform the styles on that repo.
We are using jest-glamor-react in production in our company and so far, this is a super piece of code. Thanks for your awesome work 👍! What: I've recently (first time ever) faced a weird issue in some of our (non open-sourced) components: The error is thrown only because of the snapshot creation. Removing the line fixes it (but this obviously not what we want). We are using Enzyme and all the other tests are passing (i.e. nothing is broken). The issue was triggered after splitting one component in smaller chunks. Why: For some reason, the are undefined in the method (utils). Consequently, an error is thrown in https://github.com/kentcdodds/jest-glamor-react/blob/master/src/utils.js#L37-L38 when trying to access the property of the object. How**: The changes involved are quite simple, returning an empty array early actually solves it. The unit tests of the repository are passing and our tests are not altered at all (a good sign!).
resolve #36 What: Support asymmetric matchers (#36) Why: Using asymmetric matchers make tests easier How**: see https://github.com/facebook/jest/blob/be4bec387d90ac8d6a7596be88bf8e4994bc3ed9/packages/expect/src/jasmine_utils.js#L36 This can support , and , but I do not know how to add exclusive-or-ly those peerDeps. Is there a way to do so?
Repository: kentcdodds/jest-glamor-react. Description: Jest utilities for Glamor and React Stars: 98, Forks: 21. Primary language: JavaScript. Languages: JavaScript (100%). License: MIT. Homepage: https://npm.im/jest-glamor-react Topics: css-in-js, glamor, javascript, jest, react, snapshots, testing. Latest release: v4.3.1 (8y ago). Open PRs: 0, open issues: 2. Last activity: 5y ago. Community health: 71%. Top contributors: asvetliakov, jameswlane, MicheleBertoli, emmatown, bcbrian, danreeves, yamafaktory, megaurav2002, hjylewis, Ailrun.