mtcute/e2e
2024-03-07 05:35:36 +03:00
..
.verdaccio ESM + end-to-end tests (#11) 2023-10-16 19:23:53 +03:00
cjs test(e2e): added worker tests 2024-03-07 05:35:36 +03:00
esm test(e2e): added worker tests 2024-03-07 05:35:36 +03:00
ts test(e2e): added worker tests 2024-03-07 05:35:36 +03:00
.dockerignore ESM + end-to-end tests (#11) 2023-10-16 19:23:53 +03:00
.env.example ESM + end-to-end tests (#11) 2023-10-16 19:23:53 +03:00
.gitignore ESM + end-to-end tests (#11) 2023-10-16 19:23:53 +03:00
.mocharc.json ESM + end-to-end tests (#11) 2023-10-16 19:23:53 +03:00
cli.sh ci: fix canary builds 2024-02-08 01:45:41 +03:00
config.js test(e2e): added worker tests 2024-03-07 05:35:36 +03:00
docker-compose.yaml ci: fix canary builds 2024-02-08 01:45:41 +03:00
docker-entrypoint.sh ESM + end-to-end tests (#11) 2023-10-16 19:23:53 +03:00
Dockerfile.build ESM + end-to-end tests (#11) 2023-10-16 19:23:53 +03:00
Dockerfile.test ESM + end-to-end tests (#11) 2023-10-16 19:23:53 +03:00
package.json test(e2e): added worker tests 2024-03-07 05:35:36 +03:00
pnpm-workspace.yaml ESM + end-to-end tests (#11) 2023-10-16 19:23:53 +03:00
publish-canary.js ci: fix canary builds 2024-02-08 01:45:41 +03:00
README.md ESM + end-to-end tests (#11) 2023-10-16 19:23:53 +03:00
runner.js test(e2e): added worker tests 2024-03-07 05:35:36 +03:00

mtcute e2e tests

This directory contains end-to-end tests for mtcute.

They are made for 2 purposes:

  • Ensure published packages work as expected and can properly be imported
  • Ensure that the library works with the actual Telegram API (WIP)

To achieve the first goal, we use a Verdaccio container to publish the package to, and then install it from there in another container

Setting up

Before running the tests, you need to copy .env.example to .env and fill in the values

Running tests

To run tests, you need to have Docker installed.

# first start Verdaccio:
./cli.sh start

# build and publish the package
./cli.sh update
# or a particular package
./cli.sh update tl-runtime

# run the tests
./cli.sh run
# or in docker
./cli.sh run-docker

Developing

Once you have Verdaccio running, you can run the following commands to setup the environment for development:

npm config set -L project @mtcute:registry http://verdaccio.e2e.orb.local/
./cli.sh install

Replace the URL above with the one generated with your Docker GUI of choice (e2e > verdaccio > RMB > Open in browser). Example above assumes OrbStack

Then use ./cli.sh run to run the tests