SelfieSettingsAPI

If you create a class named SelfieSettings in the package selfie, it must extend this class, and you can override the methods below to customize various behaviors of selfie. You can also put the settings class somewhere else if you set the selfie.settings system property to the fully qualified name of the class you want selfie to use.

Constructors

Link copied to clipboard
constructor()

Properties

It's possible that multiple codepaths from multiple tests can end up writing a single snapshot to a single location. If all these codepaths are writing the same value, it's fine. But it's a bit of a problem waiting to happen, because if they start writing different values, we'll have a "snapshot error" even within a single invocation, so it can't be resolved by updating the snapshot. By default we let this happen and give a nice error message if it goes wrong, but you can disallow it in the first place if you want.

Link copied to clipboard

If Selfie should look for test sourcecode in places other than the rootFolder, you can specify them here. Selfie will not store snapshots in these folders.

Link copied to clipboard
open val rootFolder: File

By default, the root folder is the first of the standard test directories. All snapshots are stored within the root folder.

Link copied to clipboard

Defaults to null, which means that snapshots are stored right next to the test that created them. Set to __snapshots__ to mimic Jest behavior.