forked from LayerZero-Labs/devtools
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🚧 Make sure to fail the tests if a snapshot is missing (LayerZero-Lab…
- Loading branch information
1 parent
c142d55
commit 694e1c1
Showing
12 changed files
with
33 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,10 @@ | |
|
||
<h1 align="center">Development</h1> | ||
|
||
<p align="center"> | ||
<a href="#troubleshooting" style="color: #a77dff">Troubleshooting</a> | ||
</p> | ||
|
||
## Code layout | ||
|
||
The code is arranged into: | ||
|
@@ -28,13 +32,14 @@ This repository contains several git submodules. To clone the repository, please | |
# 1. Clone the repository | ||
|
||
# Using HTTPS | ||
git clone https://github.com/LayerZero-Labs/devtools.git | ||
git clone --recurse-submodules https://github.com/LayerZero-Labs/devtools.git | ||
|
||
# Using SSH | ||
git clone [email protected]:LayerZero-Labs/devtools.git | ||
git clone --recurse-submodules [email protected]:LayerZero-Labs/devtools.git | ||
|
||
# 2. Install submodules | ||
# 1A. Install submodules | ||
|
||
# If you cloned the repository without the --recurse-submodules flag, you can install the required submodules by running | ||
git submodule update --init | ||
``` | ||
|
||
|
@@ -146,6 +151,18 @@ You can also pass additional arguments to the individual `test` scripts this way | |
DOCKER_COMPOSE_RUN_TESTS_TURBO_ARGS="--filter=ua-devtools-evm-hardhat-test -- wire.test" pnpm test:ci | ||
``` | ||
|
||
#### Updating snapshots | ||
|
||
By default, `jest` will run in [CI mode](https://jestjs.io/docs/cli#--ci). This means that no new snapshots will be generated by default and `jest` will fail instead. This is important since we want to make sure that there are no missing snapshots when we merge to `main` branch. | ||
|
||
To update the snapshots, you will need to run the tests in local mode (so that the new snapshots are written to your filesystem) and pass the [`--updateSnapshot`](https://jestjs.io/docs/cli#--updatesnapshot) CLI flag to `jest`: | ||
|
||
```bash | ||
DOCKER_COMPOSE_RUN_TESTS_TURBO_ARGS="-- --updateSnapshot" pnpm test:local | ||
``` | ||
|
||
If you encounter any errors coming from existing snapshots that have to do with output formatting (i.e. difference in colored/uncolored output), see the [troubleshooting section below](#troubleshooting--updating-snapshots) | ||
|
||
#### Container logs | ||
|
||
To monitor the container logs you'll need to run: | ||
|
@@ -250,7 +267,7 @@ Don't forget to reset the `registry` NPM configuration once done: | |
pnpm config set registry https://registry.npmjs.org/ | ||
``` | ||
|
||
### Troubleshooting | ||
### Troubleshooting <a id="troubleshooting"></a> | ||
|
||
#### Problems with committing | ||
|
||
|
@@ -292,7 +309,7 @@ If you encounter errors when running these tests, just set the environment varia | |
CI=1 pnpm test | ||
``` | ||
|
||
#### Problems with snapshot updating | ||
#### Problems with snapshot updating <a id="troubleshooting--updating-snapshots"></a> | ||
|
||
If snapshots are used in a test that relies on filesystem paths, the situation becomes a bit complex. In long term, we should steer away from this approach as it makes updating snapshots a bit cumbersome. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters