Of course. My apologies for replying late, I'm running out of time nowadays.
So, I lost a bit of familiarity with NestJs lastly because I have been hired as a frontend and use it only for side projects.
Therefore, I tried to analyze what I tried re-reading my own Github.
Here we go:
So I am opening my side project again, and decide that I want to update all packages using yarn upgrade --interactive. Among all those packages, TypeOrm is breaking!
I decide, in a TDD fashion, to be driven by my tests. I focus first on integration tests such as:
https://github.com/amehmeto/corpo-sano/blob/migrate/typeorm/back/src/athlete/repositories/typeorm-athlete.repository.inte.ts
For example:
it('should find an athlete by id', async () => {
const expectedAthlete = new Athlete({
...athleteFixture,
...expectedBaseEntity,
biometrics: new Biometrics(biometricsFixture),
dailyTasks: dailyTaskFixtures.map(
(fixture) =>
new DailyTask({
...fixture,
...expectedBaseEntity,
}),
),
programs: programFixtures.map(
(fixture) =>
new Program({
...fixture,
...expectedBaseEntity,
}),
),
})
const retrievedAthlete = await athleteRepository.findById(athleteFixture.id)
expect(retrievedAthlete).toStrictEqual(expectedAthlete)
})