From 4a1c3eb1ecd216de31ef378d4892ba5962c26601 Mon Sep 17 00:00:00 2001 From: Thomas Rittson <31796059+eliykat@users.noreply.github.com> Date: Thu, 11 Aug 2022 11:35:08 +1000 Subject: [PATCH] [EC-423] Fix unit tests (#3265) * Create base jest.config file * Fix various tests that were broken * Add maxWorkers to jest config * Undo change to testEnvironment * Enable tsconfig.spec.json --- apps/browser/jest.config.js | 8 ++++---- apps/browser/tsconfig.spec.json | 3 ++- apps/cli/jest.config.js | 8 +++----- apps/cli/{spec => }/test.setup.ts | 0 apps/cli/tsconfig.spec.json | 3 ++- apps/web/jest.config.js | 8 ++++---- .../trial-initiation.component.spec.ts | 5 +++++ apps/web/{test.config.ts => test.setup.ts} | 0 apps/web/tsconfig.json | 2 +- apps/web/tsconfig.spec.json | 3 ++- jest.config.js | 6 ++++++ libs/angular/jest.config.js | 9 ++++----- libs/angular/{spec => }/test.setup.ts | 0 libs/angular/tsconfig.spec.json | 3 ++- libs/common/jest.config.js | 9 ++++----- .../firefoxCsv/firefoxAccountsData.csv.ts | 2 +- .../spec/models/domain/encArrayBuffer.spec.ts | 2 +- .../spec/services/folder.service.spec.ts | 2 +- libs/common/{spec => }/test.setup.ts | 2 +- libs/common/tsconfig.spec.json | 3 ++- libs/components/jest.config.js | 9 ++++----- .../components/src/button/button.directive.ts | 4 ++-- libs/components/{spec => }/test.setup.ts | 0 libs/components/tsconfig.spec.json | 3 ++- libs/electron/jest.config.js | 8 +++----- libs/node/jest.config.js | 9 ++++----- libs/node/spec/test.setup.ts | 0 libs/{electron/spec => node}/test.setup.ts | 0 libs/node/tsconfig.spec.json | 3 ++- libs/shared/jest.config.base.js | 19 +++++++++++++++++++ package.json | 3 --- 31 files changed, 81 insertions(+), 55 deletions(-) rename apps/cli/{spec => }/test.setup.ts (100%) rename apps/web/{test.config.ts => test.setup.ts} (100%) rename libs/angular/{spec => }/test.setup.ts (100%) rename libs/common/{spec => }/test.setup.ts (89%) rename libs/components/{spec => }/test.setup.ts (100%) delete mode 100644 libs/node/spec/test.setup.ts rename libs/{electron/spec => node}/test.setup.ts (100%) create mode 100644 libs/shared/jest.config.base.js diff --git a/apps/browser/jest.config.js b/apps/browser/jest.config.js index dca19ba3bc..4f954afa9e 100644 --- a/apps/browser/jest.config.js +++ b/apps/browser/jest.config.js @@ -2,12 +2,12 @@ const { pathsToModuleNameMapper } = require("ts-jest"); const { compilerOptions } = require("./tsconfig"); +const sharedConfig = require("../../libs/shared/jest.config.base"); + module.exports = { - collectCoverage: true, - coverageReporters: ["html", "lcov"], - coverageDirectory: "coverage", - setupFilesAfterEnv: ["/test.setup.ts"], + ...sharedConfig, preset: "jest-preset-angular", + setupFilesAfterEnv: ["/test.setup.ts"], moduleNameMapper: pathsToModuleNameMapper(compilerOptions?.paths || {}, { prefix: "/", }), diff --git a/apps/browser/tsconfig.spec.json b/apps/browser/tsconfig.spec.json index fc8520e737..de184bd760 100644 --- a/apps/browser/tsconfig.spec.json +++ b/apps/browser/tsconfig.spec.json @@ -1,3 +1,4 @@ { - "extends": "./tsconfig.json" + "extends": "./tsconfig.json", + "files": ["./test.setup.ts"] } diff --git a/apps/cli/jest.config.js b/apps/cli/jest.config.js index 45ee9695ba..4f0dab845e 100644 --- a/apps/cli/jest.config.js +++ b/apps/cli/jest.config.js @@ -2,13 +2,11 @@ const { pathsToModuleNameMapper } = require("ts-jest"); const { compilerOptions } = require("./tsconfig"); +const sharedConfig = require("../../libs/shared/jest.config.base"); + module.exports = { preset: "ts-jest", - testMatch: ["**/+(*.)+(spec).+(ts)"], - setupFilesAfterEnv: ["/spec/test.setup.ts"], - collectCoverage: true, - coverageReporters: ["html", "lcov"], - coverageDirectory: "coverage", + setupFilesAfterEnv: ["/test.setup.ts"], moduleNameMapper: pathsToModuleNameMapper(compilerOptions?.paths || {}, { prefix: "/", }), diff --git a/apps/cli/spec/test.setup.ts b/apps/cli/test.setup.ts similarity index 100% rename from apps/cli/spec/test.setup.ts rename to apps/cli/test.setup.ts diff --git a/apps/cli/tsconfig.spec.json b/apps/cli/tsconfig.spec.json index fc8520e737..de184bd760 100644 --- a/apps/cli/tsconfig.spec.json +++ b/apps/cli/tsconfig.spec.json @@ -1,3 +1,4 @@ { - "extends": "./tsconfig.json" + "extends": "./tsconfig.json", + "files": ["./test.setup.ts"] } diff --git a/apps/web/jest.config.js b/apps/web/jest.config.js index 9ed34c3e5a..707e8960e3 100644 --- a/apps/web/jest.config.js +++ b/apps/web/jest.config.js @@ -2,12 +2,12 @@ const { pathsToModuleNameMapper } = require("ts-jest"); const { compilerOptions } = require("./tsconfig"); +const sharedConfig = require("../../libs/shared/jest.config.base"); + module.exports = { - collectCoverage: true, - coverageReporters: ["html", "lcov"], - coverageDirectory: "coverage", + ...sharedConfig, preset: "jest-preset-angular", - setupFilesAfterEnv: ["/test.config.ts"], + setupFilesAfterEnv: ["/test.setup.ts"], moduleNameMapper: pathsToModuleNameMapper(compilerOptions?.paths || {}, { prefix: "/", }), diff --git a/apps/web/src/app/accounts/trial-initiation/trial-initiation.component.spec.ts b/apps/web/src/app/accounts/trial-initiation/trial-initiation.component.spec.ts index aabf32bfea..9feda5af50 100644 --- a/apps/web/src/app/accounts/trial-initiation/trial-initiation.component.spec.ts +++ b/apps/web/src/app/accounts/trial-initiation/trial-initiation.component.spec.ts @@ -12,6 +12,7 @@ import { I18nPipe } from "@bitwarden/angular/pipes/i18n.pipe"; import { ApiService } from "@bitwarden/common/abstractions/api.service"; import { I18nService } from "@bitwarden/common/abstractions/i18n.service"; import { LogService } from "@bitwarden/common/abstractions/log.service"; +import { PolicyApiServiceAbstraction } from "@bitwarden/common/abstractions/policy/policy-api.service.abstraction"; import { PolicyService } from "@bitwarden/common/abstractions/policy/policy.service.abstraction"; import { StateService as BaseStateService } from "@bitwarden/common/abstractions/state.service"; import { PlanType } from "@bitwarden/common/enums/planType"; @@ -75,6 +76,10 @@ describe("TrialInitiationComponent", () => { { provide: LogService, useClass: Substitute.for() }, { provide: I18nService, useClass: Substitute.for() }, { provide: TitleCasePipe, useClass: Substitute.for() }, + { + provide: PolicyApiServiceAbstraction, + useClass: Substitute.for(), + }, { provide: VerticalStepperComponent, useClass: VerticalStepperStubComponent, diff --git a/apps/web/test.config.ts b/apps/web/test.setup.ts similarity index 100% rename from apps/web/test.config.ts rename to apps/web/test.setup.ts diff --git a/apps/web/tsconfig.json b/apps/web/tsconfig.json index fa4895114d..a27bc65afb 100644 --- a/apps/web/tsconfig.json +++ b/apps/web/tsconfig.json @@ -16,5 +16,5 @@ "preserveWhitespaces": true }, "files": ["src/polyfills.ts", "src/main.ts", "../../bitwarden_license/bit-web/src/main.ts"], - "include": ["src/connectors/*.ts", "src/**/*.stories.ts"] + "include": ["src/connectors/*.ts", "src/**/*.stories.ts", "src/**/*.spec.ts"] } diff --git a/apps/web/tsconfig.spec.json b/apps/web/tsconfig.spec.json index fc8520e737..de184bd760 100644 --- a/apps/web/tsconfig.spec.json +++ b/apps/web/tsconfig.spec.json @@ -1,3 +1,4 @@ { - "extends": "./tsconfig.json" + "extends": "./tsconfig.json", + "files": ["./test.setup.ts"] } diff --git a/jest.config.js b/jest.config.js index cfec042088..3ca7b5d6e9 100644 --- a/jest.config.js +++ b/jest.config.js @@ -12,6 +12,7 @@ module.exports = { projects: [ "/apps/browser/jest.config.js", "/apps/cli/jest.config.js", + "/apps/web/jest.config.js", "/libs/angular/jest.config.js", "/libs/common/jest.config.js", @@ -19,4 +20,9 @@ module.exports = { "/libs/electron/jest.config.js", "/libs/node/jest.config.js", ], + + // Workaround for a memory leak that crashes tests in CI: + // https://github.com/facebook/jest/issues/9430#issuecomment-1149882002 + // Also anecdotally improves performance when run locally + maxWorkers: 3, }; diff --git a/libs/angular/jest.config.js b/libs/angular/jest.config.js index 067610c081..3be0f66db5 100644 --- a/libs/angular/jest.config.js +++ b/libs/angular/jest.config.js @@ -2,14 +2,13 @@ const { pathsToModuleNameMapper } = require("ts-jest"); const { compilerOptions } = require("../shared/tsconfig.libs"); +const sharedConfig = require("../../libs/shared/jest.config.base"); + module.exports = { + ...sharedConfig, displayName: "libs/angular tests", preset: "jest-preset-angular", - testMatch: ["**/+(*.)+(spec).+(ts)"], - setupFilesAfterEnv: ["/spec/test.setup.ts"], - collectCoverage: true, - coverageReporters: ["html", "lcov"], - coverageDirectory: "coverage", + setupFilesAfterEnv: ["/test.setup.ts"], moduleNameMapper: pathsToModuleNameMapper(compilerOptions?.paths || {}, { prefix: "/", }), diff --git a/libs/angular/spec/test.setup.ts b/libs/angular/test.setup.ts similarity index 100% rename from libs/angular/spec/test.setup.ts rename to libs/angular/test.setup.ts diff --git a/libs/angular/tsconfig.spec.json b/libs/angular/tsconfig.spec.json index fc8520e737..de184bd760 100644 --- a/libs/angular/tsconfig.spec.json +++ b/libs/angular/tsconfig.spec.json @@ -1,3 +1,4 @@ { - "extends": "./tsconfig.json" + "extends": "./tsconfig.json", + "files": ["./test.setup.ts"] } diff --git a/libs/common/jest.config.js b/libs/common/jest.config.js index ac811b2edf..29309a7830 100644 --- a/libs/common/jest.config.js +++ b/libs/common/jest.config.js @@ -2,15 +2,14 @@ const { pathsToModuleNameMapper } = require("ts-jest"); const { compilerOptions } = require("../shared/tsconfig.libs"); +const sharedConfig = require("../shared/jest.config.base"); + module.exports = { + ...sharedConfig, displayName: "libs/common tests", preset: "ts-jest", testEnvironment: "jsdom", - testMatch: ["**/+(*.)+(spec).+(ts)"], - setupFilesAfterEnv: ["/spec/test.setup.ts"], - collectCoverage: true, - coverageReporters: ["html", "lcov"], - coverageDirectory: "coverage", + setupFilesAfterEnv: ["/test.setup.ts"], moduleNameMapper: pathsToModuleNameMapper(compilerOptions?.paths || {}, { prefix: "/", }), diff --git a/libs/common/spec/importers/testData/firefoxCsv/firefoxAccountsData.csv.ts b/libs/common/spec/importers/testData/firefoxCsv/firefoxAccountsData.csv.ts index 2f2c1b55e1..81dd3ec5a1 100644 --- a/libs/common/spec/importers/testData/firefoxCsv/firefoxAccountsData.csv.ts +++ b/libs/common/spec/importers/testData/firefoxCsv/firefoxAccountsData.csv.ts @@ -1,4 +1,4 @@ export const data = `"url","username","password","httpRealm","formActionOrigin","guid","timeCreated","timeLastUsed","timePasswordChanged" -"chrome://FirefoxAccounts","bla-bla-foo-bar","{""version"":1,""accountData"":{""kSync"":""xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"",""kXCS"":""xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"",""kExtSync"":""xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"",""kExtKbHash"":""xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"",""scopedKeys"":{""https://identity.mozilla.com/apps/oldsync"":{""kid"":""xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",""k"":""xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"",""kty"":""xxx""},""sync:addon_storage"":{""kid"":""xxxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"",""k"":""xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"",""kty"":""xxx""}}}}","Firefox Accounts credentials",,"{d61e37fa-2bc4-469a-bd66-41fd3b0005e0}","1612345678900","1612345678900","1612345678900" +"chrome://FirefoxAccounts","xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","{""version"":1,""accountData"":{""scopedKeys"":{""https://identity.mozilla.com/apps/oldsync"":{""kid"":""xxxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxx"",""k"":""xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"",""kty"":""xxx""},""sync:addon_storage"":{""kid"":""xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"",""k"":""xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"",""kty"":""xxx""}},""kSync"":""xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"",""kXCS"":""xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"",""kExtSync"":""xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"",""kExtKbHash"":""xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx""}}","Firefox Accounts credentials",,"{xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx}","xxxxxxxxxxxxx","xxxxxxxxxxxxx","xxxxxxxxxxxxx" "https://example.com","foo","bar",,"","{d61e37fa-2bc4-469a-bd66-41fd3b0005e0}","1612345678900","1612345678900","1612345678900" `; diff --git a/libs/common/spec/models/domain/encArrayBuffer.spec.ts b/libs/common/spec/models/domain/encArrayBuffer.spec.ts index fb36393707..609b2a16f7 100644 --- a/libs/common/spec/models/domain/encArrayBuffer.spec.ts +++ b/libs/common/spec/models/domain/encArrayBuffer.spec.ts @@ -1,7 +1,7 @@ import { EncryptionType } from "@bitwarden/common/enums/encryptionType"; import { EncArrayBuffer } from "@bitwarden/common/models/domain/encArrayBuffer"; -import { makeStaticByteArray } from "../utils"; +import { makeStaticByteArray } from "../../utils"; describe("encArrayBuffer", () => { describe("parses the buffer", () => { diff --git a/libs/common/spec/services/folder.service.spec.ts b/libs/common/spec/services/folder.service.spec.ts index 660d4a953c..31b1aad718 100644 --- a/libs/common/spec/services/folder.service.spec.ts +++ b/libs/common/spec/services/folder.service.spec.ts @@ -33,7 +33,7 @@ describe("Folder Service", () => { "1": folderData("1", "test"), }); stateService.activeAccount$.returns(activeAccount); - stateService.activeAccountUnlocked.returns(activeAccountUnlocked); + stateService.activeAccountUnlocked$.returns(activeAccountUnlocked); (window as any).bitwardenContainerService = new ContainerService(cryptoService); folderService = new FolderService(cryptoService, i18nService, cipherService, stateService); diff --git a/libs/common/spec/test.setup.ts b/libs/common/test.setup.ts similarity index 89% rename from libs/common/spec/test.setup.ts rename to libs/common/test.setup.ts index b21b45290d..17254ea34c 100644 --- a/libs/common/spec/test.setup.ts +++ b/libs/common/test.setup.ts @@ -1,6 +1,6 @@ import { webcrypto } from "crypto"; -import { toEqualBuffer } from "./matchers/toEqualBuffer"; +import { toEqualBuffer } from "./spec/matchers/toEqualBuffer"; Object.defineProperty(window, "crypto", { value: webcrypto, diff --git a/libs/common/tsconfig.spec.json b/libs/common/tsconfig.spec.json index fc8520e737..de184bd760 100644 --- a/libs/common/tsconfig.spec.json +++ b/libs/common/tsconfig.spec.json @@ -1,3 +1,4 @@ { - "extends": "./tsconfig.json" + "extends": "./tsconfig.json", + "files": ["./test.setup.ts"] } diff --git a/libs/components/jest.config.js b/libs/components/jest.config.js index 194f92fafa..e90c663ce9 100644 --- a/libs/components/jest.config.js +++ b/libs/components/jest.config.js @@ -2,14 +2,13 @@ const { pathsToModuleNameMapper } = require("ts-jest"); const { compilerOptions } = require("./tsconfig"); +const sharedConfig = require("../../libs/shared/jest.config.base"); + module.exports = { + ...sharedConfig, displayName: "libs/components tests", preset: "jest-preset-angular", - testMatch: ["**/+(*.)+(spec).+(ts)"], - setupFilesAfterEnv: ["/spec/test.setup.ts"], - collectCoverage: true, - coverageReporters: ["html", "lcov"], - coverageDirectory: "coverage", + setupFilesAfterEnv: ["/test.setup.ts"], moduleNameMapper: pathsToModuleNameMapper(compilerOptions?.paths || {}, { prefix: "/", }), diff --git a/libs/components/src/button/button.directive.ts b/libs/components/src/button/button.directive.ts index c4a4d15898..827c49c22d 100644 --- a/libs/components/src/button/button.directive.ts +++ b/libs/components/src/button/button.directive.ts @@ -61,11 +61,11 @@ export class ButtonDirective { "focus:tw-z-10", ] .concat(this.block ? ["tw-w-full", "tw-block"] : ["tw-inline-block"]) - .concat(buttonStyles[this.buttonType] ?? []); + .concat(buttonStyles[this.buttonType ?? "secondary"]); } @Input() - buttonType: ButtonTypes = "secondary"; + buttonType: ButtonTypes = null; @Input() block = false; diff --git a/libs/components/spec/test.setup.ts b/libs/components/test.setup.ts similarity index 100% rename from libs/components/spec/test.setup.ts rename to libs/components/test.setup.ts diff --git a/libs/components/tsconfig.spec.json b/libs/components/tsconfig.spec.json index fc8520e737..de184bd760 100644 --- a/libs/components/tsconfig.spec.json +++ b/libs/components/tsconfig.spec.json @@ -1,3 +1,4 @@ { - "extends": "./tsconfig.json" + "extends": "./tsconfig.json", + "files": ["./test.setup.ts"] } diff --git a/libs/electron/jest.config.js b/libs/electron/jest.config.js index 06f2234ec6..104e723a84 100644 --- a/libs/electron/jest.config.js +++ b/libs/electron/jest.config.js @@ -2,14 +2,12 @@ const { pathsToModuleNameMapper } = require("ts-jest"); const { compilerOptions } = require("../shared/tsconfig.libs"); +const sharedConfig = require("../../libs/shared/jest.config.base"); + module.exports = { + ...sharedConfig, preset: "ts-jest", testEnvironment: "jsdom", - testMatch: ["**/+(*.)+(spec).+(ts)"], - setupFilesAfterEnv: ["/spec/test.setup.ts"], - collectCoverage: true, - coverageReporters: ["html", "lcov"], - coverageDirectory: "coverage", moduleNameMapper: pathsToModuleNameMapper(compilerOptions?.paths || {}, { prefix: "/", }), diff --git a/libs/node/jest.config.js b/libs/node/jest.config.js index 056444b830..833d03cfa5 100644 --- a/libs/node/jest.config.js +++ b/libs/node/jest.config.js @@ -2,13 +2,12 @@ const { pathsToModuleNameMapper } = require("ts-jest"); const { compilerOptions } = require("../shared/tsconfig.libs"); +const sharedConfig = require("../shared/jest.config.base"); + module.exports = { + ...sharedConfig, preset: "ts-jest", - testMatch: ["**/+(*.)+(spec).+(ts)"], - setupFilesAfterEnv: ["/spec/test.setup.ts"], - collectCoverage: true, - coverageReporters: ["html", "lcov"], - coverageDirectory: "coverage", + setupFilesAfterEnv: ["/test.setup.ts"], moduleNameMapper: pathsToModuleNameMapper(compilerOptions?.paths || {}, { prefix: "/", }), diff --git a/libs/node/spec/test.setup.ts b/libs/node/spec/test.setup.ts deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/libs/electron/spec/test.setup.ts b/libs/node/test.setup.ts similarity index 100% rename from libs/electron/spec/test.setup.ts rename to libs/node/test.setup.ts diff --git a/libs/node/tsconfig.spec.json b/libs/node/tsconfig.spec.json index fc8520e737..de184bd760 100644 --- a/libs/node/tsconfig.spec.json +++ b/libs/node/tsconfig.spec.json @@ -1,3 +1,4 @@ { - "extends": "./tsconfig.json" + "extends": "./tsconfig.json", + "files": ["./test.setup.ts"] } diff --git a/libs/shared/jest.config.base.js b/libs/shared/jest.config.base.js new file mode 100644 index 0000000000..7538064c28 --- /dev/null +++ b/libs/shared/jest.config.base.js @@ -0,0 +1,19 @@ +/* eslint-env node */ +module.exports = { + testMatch: ["**/+(*.)+(spec).+(ts)"], + collectCoverage: true, + coverageReporters: ["html", "lcov"], + coverageDirectory: "coverage", + + // Workaround for a memory leak that crashes tests in CI: + // https://github.com/facebook/jest/issues/9430#issuecomment-1149882002 + // Also anecdotally improves performance when run locally + maxWorkers: 3, + + // Jest does not use tsconfig.spec.json by default + globals: { + "ts-jest": { + tsconfig: "/tsconfig.spec.json", + }, + }, +}; diff --git a/package.json b/package.json index 8675da7ba0..2da3208df0 100644 --- a/package.json +++ b/package.json @@ -203,8 +203,5 @@ "engines": { "node": "~16", "npm": "~8" - }, - "jest": { - "testEnvironment": "node" } }