Skip to main content

Improving Snapshots & User Output (v0.10.0)

· One min read
Jesse Mitchell

Hey everyone!

This release is focused on providing some additional small quality of life improvements to the tool.

Better Snapshots

Prior to this release, all snapshots were captured in a global pineapple-snapshot, and while this worked, I don't believe it made reviewing particularly effective.

When snapshots are captured, it will now save in close proximity to your file that you're testing, appending a .psnap to the file name.

So if you were testing a ./src/math.js file, the snapshot will be persisted to ./src/math.js.psnap

More Hooks

This version introduces a few new hooks for test lifecycle management.

You may now use:

  • @beforeGlobal
  • @beforeEachGlobal
  • @afterGlobal
  • @afterEachGlobal

These hooks were introduced to make it easier to pair Pineapple with measurement frameworks, where you might need to reset certain fields.

Right now, the functions invoked do not receive any arguments, but this will likely be addressed in a future version.

Better Output

In certain cases, important error feedback was suppressed by the framework, thus making it difficult to rectify issues identified by the test. This feedback should no longer be suppressed.