npm install --legacy-peer-deps
Copy the .env.local.example
file in this directory to .env.local
(which will be ignored by Git):
cp .env.local.example .env.local
### Run
```bash
npm run dev
Open http://localhost:3000 to view it in the browser.
npm run build
npm start
npm run test:unit
For unit tests we use a combination of Jest and React Testing Library
Page tests should be added to the __tests__ folder at the root as it is not possible co-locate tests and pages in nextjs. Other tests should be co-located in a __tests__ folder next to their related file.
In order to run fully automated end-2-end (e2e) tests Kwenta uses Synpress (a wrapper around Cypress).
The current e2e tests are written to be run on Optimistic Kovan using Chrome as the browser.
- Download and install Google Chrome
- Setup a test wallet on Optimistic Kovan and fund it with plenty of ETH (to pay for gas) and sUSD
- Prior to running the tests you must set the environment variables below in the shell from which npm is started. Unfortunately, at this time other methods to set said environment variables (eg. through
.env.local
) don't work in conjunction with Synpress.