I need to make a unit test for this method on the server side. I use Chai and sinon. 
Here is the method 
        this.router.post('/saveGame', async (req: Request, res: Response) => {
            const receivedNameForm: EntireGameUploadForm = req.body;
            const buffer1 = Buffer.from(receivedNameForm.firstImage.background);
            const buffer2 = Buffer.from(receivedNameForm.secondImage.background);
            const differences = this.imageProcessingService.getDifferencesPositionsList(buffer1, buffer2, receivedNameForm.radius);
            this.gameStorageService.storeGameImages(receivedNameForm.gameId, buffer1, buffer2);
            const newGameToAdd: GameData = {
                id: receivedNameForm.gameId,
                nbrDifferences: receivedNameForm.numberOfDifferences,
                name: receivedNameForm.gameName,
                differences,
                isEasy: receivedNameForm.isEasy,
                oneVersusOneRanking: defaultRanking,
                soloRanking: defaultRanking,
            };
            this.gameStorageService
                .storeGameResult(newGameToAdd)
                .then(() => {
                    // we need to send a socket to refresh the game list
                    this.socketManagerService.sendRefreshAvailableGames();
                    res.status(StatusCodes.CREATED).send({ body: receivedNameForm.gameName });
                })
                .catch((error: Error) => {
                    res.status(StatusCodes.NOT_FOUND).send(error.message);
                });
        });

Here is the test : 
        it('POST /saveGame should save a new game ', async () => {
            imageProcessingServiceStub.getDifferencesPositionsList.resolves(Promise.resolve(game.differences));
            gameStorageServiceStub.storeGameImages.resolves();
            gameStorageServiceStub.storeGameResult.resolves();
            socketManagerServiceStub.sendRefreshAvailableGames.resolves();
            const newGameToAdd: EntireGameUploadForm = {
                gameId: 2,
                firstImage: { background: [] },
                secondImage: { background: [] },
                gameName: 'saveGame test',
                isEasy: true,
                radius: 3,
                numberOfDifferences: 3,
            };
            await supertest(expressApp)
                .post(`${API_URL}/saveGame`)
                .send(newGameToAdd)
                .expect(HTTP_STATUS_CREATED)
                .then((response) => {
                    expect(response.body).to.deep.equal({ body: newGameToAdd.gameName });
                });
            sinon.restore();
        });

There is not compilation error but the test failed 
Here is the error :
1) GamesController
       "before each" hook for "GET should return game by id":
     Error: Expected to stub methods on object but found none
      at walkObject (node_modules\sinon\lib\sinon\util\core\walk-object.js:39:15)
      at stub (node_modules\sinon\lib\sinon\stub.js:99:16)
      at stub.createStubInstance (node_modules\sinon\lib\sinon\stub.js:134:25)
      at createStubInstance (node_modules\sinon\lib\sinon\sandbox.js:74:52)
      at D:\Utilisateurs\Théo\Bureau\Brodel Collège\Polytechnique Montréal\2023 - Hiver\LOG2990\LOG2990-203\server\app\controllers\games-controller\games.controller.spec.ts:32:56
      at Generator.next (<anonymous>)
      at D:\Utilisateurs\Théo\Bureau\Brodel Collège\Polytechnique Montréal\2023 - Hiver\LOG2990\LOG2990-203\server\app\controllers\games-controller\games.controller.spec.ts:8:71
      at new Promise (<anonymous>)
      at __awaiter (app\controllers\games-controller\games.controller.spec.ts:4:12)
      at Context.<anonymous> (app\controllers\games-controller\games.controller.spec.ts:28:27)
      at processImmediate (node:internal/timers:466:21)