mtcute/e2e/README.md
Alina Tumanova f5976a2d74
ESM + end-to-end tests (#11)
* feat: moved tl-runtime to esm and native ArrayBuffers

* feat: migration to esm

* fix(core): web-related fixes

* test: finally, some good fucking e2e

* chore: fixed linters etc

* ci: added e2e to ci

* build(tl): fixed gen-code on node 20

* fix: codegen Uint8Array, not Buffer

never `git reset --hard` kids

* build: only do type-aware linting for `packages/*`

* build: ignore no-unresolved in ci for e2e

* fix: node 16 doesn't have subtle crypto apparently?

* fix(tests): use Uint8Array

for gods sake please can i just merge this already

* ci: don't parallel tasks in ci

because machines are utter garbage and it may just randomly break

* ci: pass secrets to e2e tests

* ci: separate cli command for ci

apparently im retarded

* fix: run codegen in e2e

im actually retarded

* ci: more fixes for e2e

* ci: debugging stuff

* ci: still debugging

* ci: hopefully fix ci???
2023-10-16 19:23:53 +03:00

1.2 KiB

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