Skip to content

Commit

Permalink
chore(server): try fixing jest which produces non-idempotent test res…
Browse files Browse the repository at this point in the history
…ults
  • Loading branch information
Falinor committed Oct 9, 2024
1 parent 42adeaa commit 18dc602
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
6 changes: 1 addition & 5 deletions server/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@ const config: JestConfigWithTsJest = {
rootDir: '.',
roots: ['<rootDir>'],
moduleDirectories: ['node_modules', '<rootDir>'],
moduleNameMapper: {
...pathsToModuleNameMapper(tsconfig.compilerOptions.paths),
'^@zerologementvacant/models/fixtures$':
'<rootDir>/node_modules/@zerologementvacant/models/dist/test/fixtures.js'
},
moduleNameMapper: pathsToModuleNameMapper(tsconfig.compilerOptions.paths),
modulePathIgnorePatterns: [
'<rootDir>/dist/',
'<rootDir>/node_modules/',
Expand Down
10 changes: 6 additions & 4 deletions server/src/controllers/ownerController.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
OwnerDTO,
OwnerPayloadDTO
} from '@zerologementvacant/models';
import { genHousingOwnerDTO } from '@zerologementvacant/models/fixtures';
import { createServer } from '~/infra/server';
import { tokenProvider } from '~/test/testUtils';
import {
Expand All @@ -31,7 +30,7 @@ import {
OwnerEventDBO,
ownerEventsTable
} from '~/repositories/eventRepository';
import { OwnerApi, toOwnerDTO } from '~/models/OwnerApi';
import { OwnerApi } from '~/models/OwnerApi';
import db from '~/infra/database';
import {
banAddressesTable,
Expand Down Expand Up @@ -309,8 +308,11 @@ describe('Owner API', () => {
rank: number
): HousingOwnerPayloadDTO {
return {
...genHousingOwnerDTO(toOwnerDTO(owner)),
rank
id: owner.id,
rank: rank,
locprop: null,
idprocpte: null,
idprodroit: null
};
}

Expand Down

0 comments on commit 18dc602

Please sign in to comment.