close
logo
Rstest
Guide
Config
API
English
简体中文
Guide
Config
API
English
简体中文
logo
Rstest
Overview

Test Configurations

root
name
include
exclude
setupFiles
projects
update
globals
passWithNoTests
includeSource
testNamePattern
env
retry
testTimeout
hookTimeout
maxConcurrency
pool
isolate
testEnvironment
clearMocks
resetMocks
restoreMocks
unstubEnvs
unstubGlobals
coverage
reporters
logHeapUsage
hideSkippedTests
slowTestThreshold
snapshotFormat
resolveSnapshotPath
printConsoleTrace
onConsoleLog
disableConsoleIntercept

Build Configurations

plugins
source
output
resolve
tools
dev
performance
📝 Edit this page on GitHub
Previous Pagereporters
Next PagehideSkippedTests

#logHeapUsage

  • Type: boolean
  • Default: false
  • CLI: --logHeapUsage

Log heap usage for each test, it can help to find memory leaks in tests.

CLI
rstest.config.ts
import { defineConfig } from '@rstest/core';

export default defineConfig({
  logHeapUsage: true,
});

#Example

After setting logHeapUsage to true, Rstest will log heap usage for each test.

 ✓ test/index.test.ts (2) 11 MB heap used
 ✓ test/index1.test.ts (2) 11 MB heap used

 Test Files 2 passed
      Tests 2 passed | 2 skipped (4)
   Duration 233ms (build 175ms, tests 58ms)