Skip to content

Commit

Permalink
maxWorkers: '90%'
Browse files Browse the repository at this point in the history
  • Loading branch information
tamaina committed Jul 17, 2024
1 parent d3280fe commit 9e0a93f
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions packages/backend/jest.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ module.exports = {
collectCoverageFrom: ['src/**/*.ts', '!src/**/*.test.ts'],

// The directory where Jest should output its coverage files
coverageDirectory: "coverage",
coverageDirectory: 'coverage',

// An array of regexp pattern strings used to skip coverage collection
// coveragePathIgnorePatterns: [
// "\\\\node_modules\\\\"
// ],

// Indicates which provider should be used to instrument code for coverage
coverageProvider: "v8",
coverageProvider: 'v8',

// A list of reporter names that Jest uses when writing coverage reports
// coverageReporters: [
Expand Down Expand Up @@ -129,7 +129,7 @@ module.exports = {

// A list of paths to directories that Jest should use to search for files in
roots: [
"<rootDir>"
'<rootDir>',
],

// Allows you to use a custom runner instead of Jest's default test runner
Expand All @@ -148,7 +148,7 @@ module.exports = {
// snapshotSerializers: [],

// The test environment that will be used for testing
testEnvironment: "node",
testEnvironment: 'node',

// Options that will be passed to the testEnvironment
// testEnvironmentOptions: {},
Expand All @@ -158,8 +158,8 @@ module.exports = {

// The glob patterns Jest uses to detect test files
testMatch: [
"<rootDir>/test/unit/**/*.ts",
"<rootDir>/src/**/*.test.ts",
'<rootDir>/test/unit/**/*.ts',
'<rootDir>/src/**/*.test.ts',
],

// An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
Expand All @@ -184,7 +184,7 @@ module.exports = {

// A map from regular expressions to paths to transformers
transform: {
"^.+\\.(t|j)sx?$": ["@swc/jest"],
'^.+\\.(t|j)sx?$': ['@swc/jest'],
},

// An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation
Expand Down Expand Up @@ -212,7 +212,7 @@ module.exports = {
// Let Jest kill the test worker whenever it grows too much
// (It seems there's a known memory leak issue in Node.js' vm.Script used by Jest)
// https://github.com/facebook/jest/issues/11956
maxWorkers: 1, // Make it use worker (that can be killed and restarted)
maxWorkers: '90%', // Make it use worker (that can be killed and restarted)
logHeapUsage: true, // To debug when out-of-memory happens on CI
workerIdleMemoryLimit: '1GiB', // Limit the worker to 1GB (GitHub Workflows dies at 2GB)

Expand Down

0 comments on commit 9e0a93f

Please sign in to comment.