Snapshot

Snapshot

An instance snapshot.

Instances of this class are returned from Instance#snapshots and Instance#takeSnapshot. They should not be created using the constructor.

Methods

(async) delete()

Description:
  • Delete this snapshot.

Source:
Example
const snapshots = await instance.snapshots();
snapshots.forEach(snapshot => {
    console.log("Deleting snapshot " + snapshot.name)
    snapshot.delete();
});

(async) rename(name)

Description:
  • Rename this snapshot.

Source:
Example
const snapshots = await instance.snapshots();
const snapshot = snapshots.find(snapshot => snapshot.name === 'Test 1');
if (snapshot) {
    await snapshot.rename('Test 1 new');
}
Parameters:
Name Type Description
name string

The new name for the snapshot.

(async) restore()

Description:
  • Restore the instance to this snapshot.

Source:
Example
const snapshots = await instance.snapshots();
const snapshot = snapshots.find(snapshot => snapshot.name === 'Pre-Test 1');
if (snapshot) {
    await snapshot.restore();
}