Git Product home page Git Product logo

Comments (3)

statictype avatar statictype commented on July 17, 2024

investigating also camouflage and mock-socket

from contracts-ui.

statictype avatar statictype commented on July 17, 2024

after going through all the possibilities, looks like the best way is to use simple stubs

this was handled in 59b0024

other strategies are extremely unperformant / hard to maintain

from contracts-ui.

statictype avatar statictype commented on July 17, 2024

there are some performance considerations to keep in mind:

  • running jest in node --experimentalVmModules is slow and leaks memory by itself
  • jsdom is slower, but we need it
  • running a simple test that renders a component without any @PolkaDot dependencies has aprox 200mb heap in our setup, so that's the starting point
  • the code that generates the mock data we use for testing has too many computations, increasing the complexity each time it's called (a lot)
  • the app is too tightly coupled with the db (app throws errors if db not connected), not possible to delete db after some tests
  • tests mount components, no shallow testing, making everything slow. maybe some snapshot testing could be used here and there
  • there might be memory leaks in the app itself, possibly from uncleared subscriptions (subscribeNewHeads)
  • another test runner could be tried instead of jest

the memory leaks and heap size were reduced a lot in this PR, but not entirely fixed #90

from contracts-ui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.