GitShow/kentcdodds/jest-glamor-react
kentcdodds

jest-glamor-react

Jest utilities for Glamor and React

by kentcdodds
css-in-jsglamorjavascriptjestreactsnapshotstesting
Star on GitHubForkWebsitenpm

JavaScript

98 stars21 forks13 contributorsQuiet · 5y agoSince 2017v4.3.1MIT

Meet the team

See all 13 on GitHub →
asvetliakov
asvetliakov3 contributions
jameswlane
jameswlane2 contributions
MicheleBertoli
MicheleBertoli2 contributions
emmatown
emmatown2 contributions
bcbrian
bcbrian1 contribution
danreeves
danreeves1 contribution
yamafaktory
yamafaktory1 contribution
megaurav2002
megaurav20021 contribution

Languages

View on GitHub →
JavaScript100%

Commit activity

Last 12 weeks · 0 commits

Full graph →

Community health

5 of 6 standards met

Community profile →
71
✓README✓License✓Contributing○Code of Conduct✓Issue Template✓PR Template

Recent PRs & issues

Quiet · 2 discussions · Last activity 5y ago
See all on GitHub →
Ailrun
Is there any ways to get style for pseudo-class?OpenIssue

version: v4.2.1 version: v8.9.4 (or ) version: v5.6.0 Relevant code or config What you did: Try to test pseudo-class style What happened: No way to test it Problem description: Suggested solution: Add some matchers? or add functions to the matcher?

Ailrun · 5y ago
pbomb
Snapshot testing of DOM element clears out that elements childrenOpenIssue

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 .

pbomb · 8y ago

Recent fixes

View closed PRs →
chrissinclairedited
Locally linked repos do not have their components styles transformedClosedIssue

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.

chrissinclairedited · 8y ago
yamafaktory
Fix `TypeError: Cannot read property 'className' of undefined`MergedPR

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!).

yamafaktory · 8y ago
Ailrun
feat(matchers): support asymmetric matchersMergedPR

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?

Ailrun · 8y ago
Structured data for AI agents

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.

·@ofershap

Replace github.com with gitshow.dev