Re-work test setup for e2e tests
See original GitHub issueWhile working on the api-derive tests I noticed that the test setup in API could urgently need some attention. Now that we’re more people working on it who don’t necessarily know the whole code by heart (including external contributors) we should put more effort in making the tests more bulletproof and the setup more intuitive.
Suggested tasks:
- Reorder and better categorize existing tests (https://github.com/polkadot-js/api/pull/1132)
- Have a central file where all local tests are imported to be able to toggle all tests that require a local dev node (
.skip
) (https://github.com/polkadot-js/api/pull/1117) - Move all e2e tests to
./api
(see https://github.com/polkadot-js/api/issues/908#issuecomment-503513811) (https://github.com/polkadot-js/api/pull/1132) - Have a setup that runs all tests with ApiPromise and ApiRx for both Polkadot (wss://poc3-rpc.polkadot.io/) and the latest Substrate master on a local machine (Added docker-compose file with all supported versions https://github.com/polkadot-js/api/pull/1100)
- Replace console.logs in tests with actual Jest methods
- Try to bring up test coverage
- Fix broken / outdated tests
- Add some documentation for external contributors
Already existing tickets:
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (9 by maintainers)
Top Results From Across the Web
Best Practices for Creating End-to-End Tests - Datadog
Best practices for creating end-to-end tests · Define your test coverage · Build meaningful tests for key application workflows · Design coherent ...
Read more >E2E Testing: A Tutorial and Architectural Guide - Testim Blog
E2E testing helps you with both front-end and back-end testing to validate the most important flows in your app. Read this to learn...
Read more >Running E2E tests on EAS Build - Expo Documentation
Learn how to set up and run E2E tests on EAS Build with popular libraries such as Detox.
Read more >A Comprehensive Guide to End to End (E2E) Testing - Perfecto
Check out this guide to end to end (E2E) testing. Learn what end to end tests are, how they work, and see an...
Read more >End-to-end Tests And Testing - Your Complete Guide 2022
End-to-end testing is a software testing method that provides complete test coverage from beginning to end. Also called E2E testing, the goal is...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Or instead of having a central file which imports all other files to have a central
.skip
, we could do what YJ proposed here: https://github.com/polkadot-js/api/pull/1059/files#diff-b9cfc7f2cdf78a7f4b91a753d10865a2R23Related to this: I would propose to put all e2e tests into
api/
, because when testing e2e, we should test what users use, namelyconst api = new Api()
. This includes:rpc-core
: replace those tests withapi.rpc.*.*()
tests, so that’s it’s really e2eapi-derive
: they test the decoratedapi.derive.*.*
, so they are already e2e tests on api itselftype-extrinsics
: there are some tests hanging there, move them toapi.tx.*.*
tests