summaryrefslogtreecommitdiff
path: root/packages/backend/jest.config.cjs
diff options
context:
space:
mode:
authorKagami Sascha Rosylight <saschanaz@outlook.com>2023-03-03 03:13:12 +0100
committerGitHub <noreply@github.com>2023-03-03 11:13:12 +0900
commit61215e50ff9e4c84787c8d99c75fd36dafbd8815 (patch)
tree36419e8a3ec97afa0a3a0011d523d80addf8e724 /packages/backend/jest.config.cjs
parentfix(server): チャンネルでミュートが正しく機能していない... (diff)
downloadmisskey-61215e50ff9e4c84787c8d99c75fd36dafbd8815.tar.gz
misskey-61215e50ff9e4c84787c8d99c75fd36dafbd8815.tar.bz2
misskey-61215e50ff9e4c84787c8d99c75fd36dafbd8815.zip
test(backend): APIテストの復活 (#10163)
* Revert 1c5291f8185651c231903129ee7c1cee263f9f03 * APIテストの復活 * apiテストの移行 * moduleNameMapper修正 * simpleGetでthrowしないように status確認しているので要らない * longer timeout * ローカルでは問題ないのになんで * case sensitive * Run Nest instance within the current process * Skip some setIntervals * wait for 5 seconds * kill them all!! * logHeapUsage: true * detectOpenHandlesがじゃましているらしい * maxWorkers=1? * restore drive api tests * workerIdleMemoryLimit: 500MB * 1024MiB * Wait what
Diffstat (limited to 'packages/backend/jest.config.cjs')
-rw-r--r--packages/backend/jest.config.cjs13
1 files changed, 11 insertions, 2 deletions
diff --git a/packages/backend/jest.config.cjs b/packages/backend/jest.config.cjs
index 8a11ad848c..6b1afec734 100644
--- a/packages/backend/jest.config.cjs
+++ b/packages/backend/jest.config.cjs
@@ -91,7 +91,7 @@ module.exports = {
// See https://github.com/swc-project/jest/issues/64#issuecomment-1029753225
// TODO: Use `--allowImportingTsExtensions` on TypeScript 5.0 so that we can
// directly import `.ts` files without this hack.
- '^(\\.{1,2}/.*)\\.js$': '$1',
+ '^((?:\\.{1,2}|[A-Z:])*/.*)\\.js$': '$1',
},
// An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader
@@ -160,7 +160,7 @@ module.exports = {
testMatch: [
"<rootDir>/test/unit/**/*.ts",
"<rootDir>/src/**/*.test.ts",
- //"<rootDir>/test/e2e/**/*.ts"
+ "<rootDir>/test/e2e/**/*.ts",
],
// An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
@@ -207,4 +207,13 @@ module.exports = {
// watchman: true,
extensionsToTreatAsEsm: ['.ts'],
+
+ testTimeout: 60000,
+
+ // 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)
+ logHeapUsage: true, // To debug when out-of-memory happens on CI
+ workerIdleMemoryLimit: '1GiB', // Limit the worker to 1GB (GitHub Workflows dies at 2GB)
};