Skip to content
This repository was archived by the owner on Sep 25, 2025. It is now read-only.

Commit 9587745

Browse files
fix: get tests running (#470)
* fix: allow tests to run * fix: suppress console.warn during tests
1 parent 4d1c561 commit 9587745

3 files changed

Lines changed: 3 additions & 9 deletions

File tree

jest.config.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
/* eslint-disable @typescript-eslint/no-var-requires */
2-
const { pathsToModuleNameMapper } = require('ts-jest/utils');
3-
const { compilerOptions } = require('./tsconfig');
4-
51
module.exports = {
62
preset: 'ts-jest',
73
testEnvironment: 'node',
@@ -10,9 +6,8 @@ module.exports = {
106
'^.+\\.tsx?$': 'babel-jest',
117
},
128
moduleDirectories: ['node_modules', 'server'],
13-
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths, {
14-
prefix: '<rootDir>/',
15-
}),
9+
// if we need to use paths in tsconfig, we should use pathsToModuleNameMapper
10+
// from ts-jest
1611
globals: {
1712
'ts-jest': {
1813
diagnostics: false,

server/tests/Mailer.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import Utilities from 'server/util/Utilities';
99
chai.use(sinonChai);
1010

1111
beforeEach(() => {
12-
sinon.spy(console, 'warn');
12+
sinon.stub(console, 'warn');
1313
});
1414

1515
afterEach(() => {

tsconfig.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
"compilerOptions": {
3-
"baseUrl": ".",
43
"allowJs": true,
54
"allowSyntheticDefaultImports": true,
65
"jsx": "preserve",

0 commit comments

Comments
 (0)