diff --git a/src/backend/jest.config.js b/src/backend/jest.config.js index 8e696ab5..77f19338 100644 --- a/src/backend/jest.config.js +++ b/src/backend/jest.config.js @@ -1,4 +1,5 @@ module.exports = { preset: "ts-jest", + setupFiles: ['../../test/setup.jest.ts'], testEnvironment: 'node', }; diff --git a/src/frontend/jest.config.js b/src/frontend/jest.config.js index 3756a3c1..73f8c1e9 100644 --- a/src/frontend/jest.config.js +++ b/src/frontend/jest.config.js @@ -8,5 +8,6 @@ module.exports = { moduleNameMapper: { '\\.(scss|sass|css)$': 'identity-obj-proxy', }, + setupFiles: ['../../test/setup.jest.ts'], testEnvironment: 'jsdom', }; diff --git a/test/e2e/backend/jest.config.js b/test/e2e/backend/jest.config.js index 8e696ab5..9225fb89 100644 --- a/test/e2e/backend/jest.config.js +++ b/test/e2e/backend/jest.config.js @@ -1,4 +1,5 @@ module.exports = { preset: "ts-jest", + setupFiles: ['../../setup.jest.ts'], testEnvironment: 'node', }; diff --git a/test/e2e/backend/util/jest.setup.ts b/test/e2e/backend/util/jest.setup.ts deleted file mode 100644 index ca86f1c4..00000000 --- a/test/e2e/backend/util/jest.setup.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * This file is part of Sh**t! I Smoke. - * - * Copyright (C) 2018-2021 Marcelo S. Coelho, Amaury M. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -import { config } from 'dotenv'; - -config({ path: '.env.development' }); diff --git a/test/setup.jest.ts b/test/setup.jest.ts new file mode 100644 index 00000000..8902e236 --- /dev/null +++ b/test/setup.jest.ts @@ -0,0 +1,3 @@ +import { config } from 'dotenv'; + +config();