Skip to content

Instantly share code, notes, and snippets.

View tvanmaren's full-sized avatar
🎛️
in your code, tweaking your test specs

Tristan Van Maren tvanmaren

🎛️
in your code, tweaking your test specs
View GitHub Profile
@tvanmaren
tvanmaren / keybase.md
Created February 18, 2019 17:05
Keybase proof

Keybase proof

I hereby claim:

  • I am tvanmaren on github.
  • I am tvanmaren (https://keybase.io/tvanmaren) on keybase.
  • I have a public key ASCwWJoZOVQ3-_RQrMJeT0F-jGr4bsprEwtgTL0pYSmI7Qo

To claim this, I am signing this object:

@tvanmaren
tvanmaren / code_design.md
Last active May 16, 2022 17:07
On Code Design

On Code Design

Designing code is its own task separate from implementing it. Not having a design--or having a fundamental failure of design--is, I think, what we really mean when we say code "needs a refactor". That is, refactoring code is re-designing code. Nobody ever refactors without some kind of design, regardless of whether that design has ever made it outside their head, let alone their subconscious.

So in order to refactor, we must first design. But when we design, if we have the wrong goal in mind, we can easily find ourselves doing more harm than good. Is it just me, or have we all had that time we took that block of ugly code and cleaned it up nice and proper, only to have a colleague later call the new code incomprehensible? And for them to be right, because it is?

So good design--intelligible design--matters. It matters a lot. And the wrong design--like the wrong abstraction--generally does more harm than good. So how do we know that our design is good? How do we know our design now won't ju

@tvanmaren
tvanmaren / cleaning-up-jest.md
Last active August 19, 2022 20:35
On Refactoring Jest Test Suites

Jest Slowness and Errors

Jest Version

The following packages can be upgraded to improve performance and avoid any potential jest bugs that might be kinking up the works inadvertently:

@testing-library/jest-dom latest is fine; currently at 5.16.5
@testing-library/react can't upgrade to 13 until we're on React 18, so 12.1.5 works for now