Metamask Snaps Testing

Hi gang, I am trying to test my Snap. I followed the Test a Snap guide posted on Snap Docs site. I am getting the following error :-

ReferenceError: snapsEnvironment is not defined

The error occurs on this line just before the installSnap function

const { request, close } = await installSnap();

Can someone please help me out explaining why this error is occuring? Thanks. :slight_smile:

Have a great day, cheers.

Hi @iamyxsh could you please share the exact url where installSnap function is coming from

const { installSnap } = require('@metamask/snaps-jest');

My jest.config.js

module.exports = {
  preset: '@metamask/snaps-jest',


I was running the command npx jest instead of yarn test (actually, the template I was using did not have test command).

Second problem I ran into is that I am using Linux on M1 chip which has compability issue bw chrome and arm based linux (I think).

The issue has been resolved. :slight_smile:

1 Like

Great to hear thanks for the update!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.