You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Documented how to use the SDK CLI to set up a [JavaScript + Wagmi](/sdk/quickstart/javascript-wagmi) or [Dynamic SDK](/sdk/quickstart/javascript-dynamic) project.
3. Test your Snap by calling its API methods from a dapp.
21
+
22
+
## Test in the sandbox
23
+
24
+
Use the Snaps sandbox to test and debug your Snap in an easy-to-use interface.
25
+
26
+
1. Run the [`sandbox`](../reference/cli.md#sandbox) subcommand to start the sandbox server:
27
+
28
+
```bash
29
+
yarn mm-snap sandbox
30
+
```
31
+
32
+
Navigate to the `localhost` URL displayed in the terminal.
33
+
34
+
2. Install your Snap in Flask.
35
+
36
+
3. Test your Snap by calling its API methods from the sandbox interface.
37
+
38
+
## Test end-to-end
39
+
40
+
Follow these steps to test your Snap end-to-end in a Jest environment.
16
41
17
42
### 1. Install `@metamask/snaps-jest`
18
43
19
-
Install the `@metamask/snaps-jest` package into your Snap project using [Yarn](https://yarnpkg.com/)
44
+
Install the [`@metamask/snaps-jest`](https://github.com/MetaMask/snaps/tree/main/packages/snaps-jest) package into your Snap project using [Yarn](https://yarnpkg.com/)
Copy file name to clipboardExpand all lines: snaps/reference/cli.md
+25-8Lines changed: 25 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,14 @@
1
1
---
2
-
sidebar_label: Subcommands
3
-
sidebar_position: 2
2
+
sidebar_label: Snaps CLI
3
+
sidebar_position: 3
4
4
toc_max_heading_level: 4
5
5
description: See the Snaps CLI subcommands reference.
6
6
---
7
7
8
8
import Tabs from "@theme/Tabs";
9
9
import TabItem from "@theme/TabItem";
10
10
11
-
# Snaps subcommands
11
+
# Snaps CLI
12
12
13
13
This reference describes the syntax of the Snaps command line interface (CLI) subcommands and
14
14
subcommand options.
@@ -19,6 +19,11 @@ You can specify subcommands and their options using the `yarn mm-snap` command:
19
19
yarn mm-snap [SUBCOMMAND] [SUBCOMMAND OPTIONS]
20
20
```
21
21
22
+
:::note
23
+
This documentation assumes you created your Snap using the [`@metamask/create-snap`](https://github.com/MetaMask/snaps/tree/main/packages/create-snap) starter kit, which includes the Snaps CLI.
24
+
You can also install the CLI directly using the [`@metamask/snaps-cli`](https://github.com/MetaMask/snaps/tree/main/packages/snaps-cli) package.
25
+
:::
26
+
22
27
### `b`, `build`
23
28
24
29
```bash
@@ -41,7 +46,7 @@ yarn mm-snap build --analyze
41
46
</TabItem>
42
47
</Tabs>
43
48
44
-
Enables analyzing the Snap [bundle](../../learn/about-snaps/files.md#bundle-file).
49
+
Enables analyzing the Snap [bundle](../learn/about-snaps/files.md#bundle-file).
45
50
This uses [`webpack-bundle-analyzer`](https://github.com/webpack-contrib/webpack-bundle-analyzer) under the hood,
46
51
which creates an interactive visualization of the contents of your bundle.
47
52
The visualization is located at the URL displayed in the command line output (for example, `http://localhost:8888`).
0 commit comments