Просмотр исходного кода

read custom tsconfig.json when jest run

Yuki Takei 1 год назад
Родитель
Сommit
991517fb05

+ 2 - 2
apps/app/package.json

@@ -35,9 +35,9 @@
     "lint": "run-p lint:*",
     "prelint:swagger2openapi": "yarn openapi:v3",
     "test": "run-p test:*",
-    "test:jest": "cross-env NODE_ENV=test NODE_OPTIONS=\"--max-old-space-size=4096\" jest --logHeapUsage",
+    "test:jest": "cross-env NODE_ENV=test TS_NODE_PROJECT=test/integration/tsconfig.json jest",
     "test:vitest": "run-p vitest:run vitest:run:integ vitest:run:components",
-    "jest:run": "cross-env NODE_ENV=test jest --passWithNoTests -- ",
+    "jest:run": "cross-env NODE_ENV=test TS_NODE_PROJECT=test/integration/tsconfig.json jest --passWithNoTests -- ",
     "reg:run": "reg-suit run",
     "vitest:run": "vitest run config src --coverage",
     "vitest:run:integ": "vitest run -c vitest.config.integ.ts src --coverage",

+ 1 - 1
apps/app/test/cypress/tsconfig.json

@@ -4,7 +4,7 @@
     "noEmit": true,
     // be explicit about types included
     // to avoid clashing with Jest types
-    "types": ["cypress"],
+    "types": ["cypress", "cypress-real-events"],
     // turn off sourceMap
     // see: https://github.com/cypress-io/cypress/issues/26203
     "sourceMap": false

+ 6 - 0
apps/app/test/integration/tsconfig.json

@@ -0,0 +1,6 @@
+{
+  "extends": "../../tsconfig.json",
+  "compilerOptions": {
+    "module": "CommonJS"
+  },
+}

+ 0 - 7
apps/app/test/tsconfig.json

@@ -1,7 +0,0 @@
-{
-  "extends": "../tsconfig.json",
-  "compilerOptions": {
-    "isolatedModules": false,
-    "types": ["cypress", "cypress-real-events"],
-  },
-}