Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add onKeyringRequest to snaps-jest #2777

Merged
merged 10 commits into from
Oct 9, 2024
Merged

Add onKeyringRequest to snaps-jest #2777

merged 10 commits into from
Oct 9, 2024

Conversation

david0xd
Copy link
Contributor

@david0xd david0xd commented Oct 1, 2024

Add possibility to test onKeyringRequest with snaps-jest.

Fixes: #2775

Keyring test example:

describe("onKeyringRequest", () => {
  it("sends keyring request", async () => {
    const { onKeyringRequest } = await installSnap();

    const response = await onKeyringRequest(
      {
        origin: "https://metamask.github.io",
        params: {
          options: {
            privateKey: "foo bar"
          }
        },
        method: "keyring_createAccount"
      });

    expect(response).toBe({ /* Add expected result here */ });
  });
});

@david0xd david0xd self-assigned this Oct 1, 2024
Copy link

codecov bot commented Oct 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.44%. Comparing base (fae7855) to head (8301727).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2777   +/-   ##
=======================================
  Coverage   94.44%   94.44%           
=======================================
  Files         484      484           
  Lines       10309    10314    +5     
  Branches     1567     1567           
=======================================
+ Hits         9736     9741    +5     
  Misses        573      573           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@david0xd david0xd marked this pull request as ready for review October 9, 2024 10:44
@david0xd david0xd requested a review from a team as a code owner October 9, 2024 10:44
@david0xd david0xd merged commit 02c70c7 into main Oct 9, 2024
166 checks passed
@david0xd david0xd deleted the dd/add-keyring-handler branch October 9, 2024 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add keyring handler to snaps-jest
2 participants