@metamask/snaps-jest
Version:
A Jest preset for end-to-end testing MetaMask Snaps, including a Jest environment, and a set of Jest matchers
14 lines • 515 B
JavaScript
import { assert } from "@metamask/utils";
/**
* Get the Snaps environment. This asserts that the environment has been
* configured.
*
* @returns The Snaps environment.
*/
export function getEnvironment() {
// `snapsEnvironment` is a global variable that is set by the Jest
// environment.
assert(typeof snapsEnvironment !== 'undefined', 'Snaps environment not found. Make sure you have configured the environment correctly.');
return snapsEnvironment;
}
//# sourceMappingURL=environment.mjs.map