pointfreeco / swift-snapshot-testing

📸 Delightful Swift snapshot testing.
https://www.pointfree.co/episodes/ep41-a-tour-of-snapshot-testing
MIT License
3.73k stars 565 forks source link

Compared to vitest snapshot testing of json swift-snapshot-testing is slow #755

Closed doozMen closed 1 year ago

doozMen commented 1 year ago

I realise this is not a very good description I it is more a question if you have an idea why a simple json rendering test is slow compared to vtest doing the same thing?

Any idea how to speed up snapshot tests compared to a test with a hardcoded string value?

For example in my tests a test like below tripled in duration when converted to snapshots

func testEncode() {
  let sut = try JSONEncoder().encode(Foo.self)

  let expected = """
  {
  ...
  }
  """
  XCAssertEqual(sut, expected)
mbrandonw commented 1 year ago

Hi @doozMen, since this is more of a question than an issue I am going to convert it over to a GitHub discussion.