Skip to content

Commit

Permalink
chore: update testing docs
Browse files Browse the repository at this point in the history
  • Loading branch information
alexlwn123 committed Oct 3, 2024
1 parent c0d5174 commit 5994498
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 31 deletions.
5 changes: 5 additions & 0 deletions .changeset/great-mugs-yawn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@fedimint/core-web': patch
---

Added Nix devshell to run Devimint within testing suite
24 changes: 24 additions & 0 deletions docs/core/dev/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,30 @@ Vitest [browser mode](https://vitest.dev/guide/browser/) + playwright (provider)

This framework should be suitable for all the additional libraries we have planned (e.g. react).

## Nix

The Fedimint Web SDK depends on several external pieces of infrastructure. In order to run high-fidelity tests, we utilize a tool from the [fedimint](https://github.com/fedimint/fedimint) repo called [Devimint](https://github.com/fedimint/fedimint/tree/master/devimint). Devimint includes several pieces of infrastructure for running a local testing environment for fedimint applications including a bitcoind node (regtest), multiple guardian servers (fedimintd), multiple lightning gateways (lnd, cln), and a faucet for minting tokens.

## Nix Installation & Setup

To setup nix, use the [Determinate Nix Installer](https://github.com/DeterminateSystems/nix-installer)

```sh
# The exact version might be different.
> nix --version
nix (Nix) 2.9.1
```

Next, [install direnv](https://direnv.net/docs/installation.html) and run the following command to initialize direnv in your shell:

```sh
direnv allow
```

::: tip
This takes a really long time to run for the first time. All future runs will be relatively quick.
:::

## Usage

```bash
Expand Down
80 changes: 49 additions & 31 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5994498

Please sign in to comment.