Skip to content

Commit dba66a3

Browse files
committed
Move errors and events to tracked property to avoid confusion
1 parent f871a57 commit dba66a3

File tree

9 files changed

+368
-286
lines changed

9 files changed

+368
-286
lines changed

packages/snaps-jest/src/global.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
/* eslint-disable @typescript-eslint/consistent-type-definitions, @typescript-eslint/naming-convention, @typescript-eslint/no-empty-object-type, @typescript-eslint/no-unused-vars, @typescript-eslint/no-namespace */
22

33
import type {
4-
TrackEventParams,
54
EnumToUnion,
65
NotificationType,
76
ComponentOrElement,
8-
TrackableError,
97
} from '@metamask/snaps-sdk';
108
import type { JSXElement } from '@metamask/snaps-sdk/jsx';
119

@@ -79,7 +77,8 @@ interface SnapsMatchers {
7977

8078
/**
8179
* Assert that the Snap tracked an error with the expected parameters. This
82-
* is equivalent to calling `expect(response.errors).toContainEqual(error)`.
80+
* is equivalent to calling
81+
* `expect(response.tracked.errors).toContainEqual(error)`.
8382
*
8483
* @param error - The expected error parameters.
8584
* @throws If the snap did not track an error with the expected parameters.
@@ -94,7 +93,8 @@ interface SnapsMatchers {
9493

9594
/**
9695
* Assert that the Snap tracked an event with the expected parameters. This
97-
* is equivalent to calling `expect(response.events).toContainEqual(event)`.
96+
* is equivalent to calling
97+
* `expect(response.tracked.events).toContainEqual(event)`.
9898
*
9999
* @param event - The expected event parameters.
100100
* @throws If the snap did not track an event with the expected parameters.

0 commit comments

Comments
 (0)