maxWorkers: '90%'

This commit is contained in:
tamaina 2024-07-17 17:08:08 +09:00
parent d3280fe7b3
commit 9e0a93f110
1 changed files with 8 additions and 8 deletions

View File

@ -23,7 +23,7 @@ module.exports = {
collectCoverageFrom: ['src/**/*.ts', '!src/**/*.test.ts'], collectCoverageFrom: ['src/**/*.ts', '!src/**/*.test.ts'],
// The directory where Jest should output its coverage files // The directory where Jest should output its coverage files
coverageDirectory: "coverage", coverageDirectory: 'coverage',
// An array of regexp pattern strings used to skip coverage collection // An array of regexp pattern strings used to skip coverage collection
// coveragePathIgnorePatterns: [ // coveragePathIgnorePatterns: [
@ -31,7 +31,7 @@ module.exports = {
// ], // ],
// Indicates which provider should be used to instrument code for coverage // 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 // A list of reporter names that Jest uses when writing coverage reports
// coverageReporters: [ // coverageReporters: [
@ -129,7 +129,7 @@ module.exports = {
// A list of paths to directories that Jest should use to search for files in // A list of paths to directories that Jest should use to search for files in
roots: [ roots: [
"<rootDir>" '<rootDir>',
], ],
// Allows you to use a custom runner instead of Jest's default test runner // Allows you to use a custom runner instead of Jest's default test runner
@ -148,7 +148,7 @@ module.exports = {
// snapshotSerializers: [], // snapshotSerializers: [],
// The test environment that will be used for testing // The test environment that will be used for testing
testEnvironment: "node", testEnvironment: 'node',
// Options that will be passed to the testEnvironment // Options that will be passed to the testEnvironment
// testEnvironmentOptions: {}, // testEnvironmentOptions: {},
@ -158,8 +158,8 @@ module.exports = {
// The glob patterns Jest uses to detect test files // The glob patterns Jest uses to detect test files
testMatch: [ testMatch: [
"<rootDir>/test/unit/**/*.ts", '<rootDir>/test/unit/**/*.ts',
"<rootDir>/src/**/*.test.ts", '<rootDir>/src/**/*.test.ts',
], ],
// An array of regexp pattern strings that are matched against all test paths, matched tests are skipped // An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
@ -184,7 +184,7 @@ module.exports = {
// A map from regular expressions to paths to transformers // A map from regular expressions to paths to transformers
transform: { 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 // An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation
@ -212,7 +212,7 @@ module.exports = {
// Let Jest kill the test worker whenever it grows too much // 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) // (It seems there's a known memory leak issue in Node.js' vm.Script used by Jest)
// https://github.com/facebook/jest/issues/11956 // 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 logHeapUsage: true, // To debug when out-of-memory happens on CI
workerIdleMemoryLimit: '1GiB', // Limit the worker to 1GB (GitHub Workflows dies at 2GB) workerIdleMemoryLimit: '1GiB', // Limit the worker to 1GB (GitHub Workflows dies at 2GB)