Update test suite / Fix deactivated tests along TypeScript transition
Closed this issue · 3 comments
Many tests of the library have been deactivated during the TypeScript
transition #144 to keep the test suite passing. One main problem was the usage of the testdouble mockup library, which plays not very well with an ES6
/ TypeScript
combination. There is some added ES6 support in newer versions, but this implies the replacement of the whole Node module loader, which is just too much of an intervention and should be avoided for a test setup here just for the sake of having a mockup library working.
The following is a list of tests being deactivated:
- integration/lightsync.ts
- net/peer/libp2pnode.ts
- net/pper/libp2ppeer.skip (!)
- net/peer/peer.ts
- net/peer/rlpxpeer.ts
- net/protocol/ethprotocol.ts
- net/protocol/lesprotocol.ts
- net/protocol/protocol.ts
- net/server/libp2pserver.ts
- net/server/rlpxserver.ts
- net/peerpool.ts
- service/fastethereumservice.ts
- service/lightethereumservice.ts
- sync/sync.ts
These tests should be reactivated over time. 😀
It would be good if this can be done along with having a look and (re-)consider what functionality is actually tested and not just trying to bring everything back to life. Some tests might also be too trivial now in aTypeScript
environment and it might be more appropriate to just remove. For some tests it might be useful to rather replace with alternative test scenarios than just trying to replicate the old testing functionality.
On the specific testdouble
issue it might be worth to have a look into alternative mockup libraries (Sinon.js seemed not to be such a suited candidate, see comment here), another way might be to just use manually created / manual mocks where necessary or see what hinders the setup to just use the respective original class.
Just a status note: am currently working on lib/blockchain
(integrating the latest monorepo releases). It's not listed above but its dependency problems are (likely) causing the karma tests to fail.