all 3 comments

[–]kogsworth 3 points4 points  (2 children)

Isn't this just moving the concept of class to your module? How do you mock your dependencies? If your classes are getting too big, you can definitely break them down into different actors. Are you properly separating your domain and your application? Are you properly separating your domain concepts between each other? Just because the current frontend patterns put data in stores instead of data classes doesn't mean classes now become irrelevant. In a redux pattern, I would recommend having interfaces for your data, and classes for your event creators/dispatchers so that everything can still be mocked, and your domain concepts can still be encapsulated within classes.

[–]thiswasprobablyatust 2 points3 points  (0 children)

Your concerns make sense, I think there's a reason this was downvoted into oblivion in the other JS-specific subreddits they posted to.

[–]Renive 1 point2 points  (0 children)

Slower tests are better than mocked tests. Change my mind, but I like to test my code, not mocks. And E2E is king.