question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[typescript] Dependency on `enzyme` should be abstracted

See original GitHub issue

Problem description

The typings contain a dependency on enzyme that would require anyone using material-ui with typescript to also install @types/enzyme, and also enzyme for testing.

Steps to reproduce

N/A

Versions

  • Material-UI: 1.0.0-beta.6
  • React: N/A
  • Browser: N/A

Description

I would like to suggest the testing utils specific to enzyme be moved into another package (e.g. material-ui-enzyme). Any testing utilities that come with material-ui should probably only depend on React itself so as to leave developers the freedom of choice with it comes to testing.

Images & references

N/A

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:10 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
oliviertassinaricommented, Aug 29, 2017

Alright, I’m going to close the issue. To sum up:

  • We want to enzyme dependency of the test helpers to be explicit
  • Some might find the test helpers useful, so we keep them
  • It would be better in terms of package delivery to ship the tests helpers into their own material-ui-test package (so we can have a finer grain control on the dependency and peer dependency). This is something we started discussing here #7839. But, this has an important maintenance cost. For now, I do think that it would be better to wait and see if that worth it.

Thanks for the discussion, we can always reopen the issue if you don’t agree, or want to push into a different direction.

1reaction
oliviertassinaricommented, Aug 28, 2017

Also, you don’t need to install enzyme only the typings.

👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

[typescript] Dependency on enzyme should be abstracted #7929
I would like to suggest the testing utils specific to enzyme be moved into another package (e.g. material-ui-enzyme ). Any testing utilities ...
Read more >
Understanding the dependency inversion principle in TypeScript
The first principle states that both high-level and low-level modules should depend on the same abstractions.
Read more >
React project (using Typescript and Styled Components ...
Recently I was tasked to setup Jest and Enzyme Testing for the ... Above is not a dev dependency, so we will install...
Read more >
Which Enzyme adapter works with React 17? - Stack Overflow
You should aim to test the behaviour of your component, thus if you correctly abstracted a component and behaviour changes... you can capture...
Read more >
typescript extend class constructor - Lena's Italian Restaurant
Define an abstract class in Typescript using the abstract keyword. ... In reality, the child class must also specify the dependencies of the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found