CodeFoodPixels’s avatarCodeFoodPixels’s Twitter Archive—№ 4,568

    1. I like TAP and I like snapshot testing, so I've been putting together a little helper so I can do snapshot tests with TAP
  1. …in reply to @CodeFoodPixels
    Today I got the code for the initial version done, gotta do tests and docs next.
    1. …in reply to @CodeFoodPixels
      People's assumption of snapshot testing is that it's just for HTML or React, but in reality you can use it for any serializable object.
      1. …in reply to @CodeFoodPixels
        I've used pretty-format for the most common serialization, but made sure to allow for a serializer to be passed in as an option
        1. …in reply to @CodeFoodPixels
          That way, if you have a custom object, you can serialize it however you want.
          1. …in reply to @CodeFoodPixels
            I seem to write modules without running the code. I ran a little example and had a couple of misspellings but it worked after that
            1. …in reply to @CodeFoodPixels
              We'll see how it holds up when I get some tests done.