🖌️
Product Process Documentation
  • Product Process Documentation
  • Definition of Done (DoD)
    • General checkpoints
      • Specific checkpoints by team
    • Important process: QA review & PO review
      • QA Review
      • PO Review
  • Work Items
    • Product Backlog Item (PBI)
    • Bug
      • Basic rules for creating a bug
      • How to report a Bug
    • Bugs Management
  • Code Standards
  • Different Test Levels
    • Unit Test
      • Frontend Unit Testing
        • What is a Unit Test?
        • How do I know if I am developing a good unit test?
        • AAA (Arrange, Act and Assert)
        • Overloaded test suits
        • Setup & Teardown
          • JEST Mocks
          • FakeTimers
        • Istanbul Annotations
        • C8 Annotations
        • JEST Runner (Debug unit tests with Jest)
    • Component Test
      • Frontend Component Testing
        • What is Component Testing?
        • Best practices
        • Bad practices
        • Setup
          • Sandbox
          • Mocks, Services and Providers
          • Test scenario
    • Integration Test
      • Frontend Integration Testing
        • What is a Integration Test?
        • AAA (Arrange, Act and Assert)
        • Best Practices
        • Bad practices
        • Setup & Teardown
        • How to create a scenario
          • Create the migrated app
          • Add to project
        • How to debug
        • Common problems
      • Testing Driven Development Guide and recommendations
    • Functional Test
    • Security Testing
      • Security Testing Tools
      • Frontend Security Testing
    • Performance testing
    • Best Practices
    • Test Documentation
  • Run test projects
    • General steps
    • Specific steps by team
  • DevOps
    • Pipelines
    • Builds
    • Specific information by team
    • Test plan
    • Service Hooks for Azure DevOps Notifications
      • Slack Notifications
      • Microsoft Teams Notifications
  • Dashboards
    • General
    • QA Dashboards
  • Release Process
    • General Steps
    • Specific steps by team
  • Migration Cells
    • Basics of testing process
  • Release process
  • References
Powered by GitBook
On this page

Was this helpful?

  1. Different Test Levels
  2. Unit Test
  3. Frontend Unit Testing

Overloaded test suits

PreviousAAA (Arrange, Act and Assert)NextSetup & Teardown

Last updated 2 years ago

Was this helpful?

It is important not to add new unit tests if a test suite already exceeds a very high memory limit. It is optimal that the memory used by a test suit is within the range of 1500 mb to 1600 mb, this data can be verified in the terminal after executing the tests of some suite.

It is recommended to create and configure another spec.ts file in order to add new unit tests.

How to check memory values by test suite

In order to get heap memory values on Jest, the logHeapUsage flag is used. This flag allows to log the memory values when running the unit tests. In addition, to look for memory leaks it runs along with runInBand flag. Here is an example of the instruction to run the unit tests:

// LogHeapUsage
"test":  "node --expose-gc --max-old-space-size=1500 ./node_modules/jest/bin/jest --config ./jest.config.js --coverage --max-workers=3 --logHeapUsage --silent",

// To look for memory leaks
"test-heap":  "node --expose-gc ./node_modules/jest/bin/jest --config ./jest.config.js --coverage --runInBand --logHeapUsage --silent",

// To inspect memory with Chrome DevTools with flag --inspect-brk
"test-leak-inspect":  "node --inspect-brk --expose-gc ./node_modules/jest/bin/jest --config ./jest.config.js --coverage --runInBand --logHeapUsage --silent",

These scripts are already located on package.json of each of the frameworks repositories.

If using Jest Runner --logHeapUsage flag can be added through settings. That can be found on Jest Runner section.