Questions for developers

I now have a development space thanks to @VonOx.
He was able to explain a lot of things to me.
I am now operational (at my level of course) to make PRs on GitHub.
This is what I did to start updating the chat.
All tests passed for my first changes.

I thought cool!!! I continue.
I added quite a few sentences and did some translations. I ran prettier and eslint to check, everything is ok.

But the test server no longer works, I have 4 errors. I don’t understand why.

`1) POST /api/v1/message
   should send message:
 Error: Timeout of 2000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/home/linux-vins/Gladys/server/test/controllers/message/message.test.js)
  at listOnTimeout (internal/timers.js:554:17)
  at processTimers (internal/timers.js:497:7)`

2) brain should train brain: TypeError: Cannot read property 'forEach' of undefined at /home/linux-vins/Gladys/server/lib/brain/brain.train.js:15:24 at Array.forEach (<anonymous>) at Brain.train (lib/brain/brain.train.js:13:25) at Context.<anonymous> (test/lib/brain/brain.test.js:7:17) at processImmediate (internal/timers.js:461:21)

3) brain should classify sentence: Error: Timeout of 2000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/home/linux-vins/Gladys/server/test/lib/brain/brain.test.js)

4) brain should getReply: Error: Answer with intent calendar.next-event.get-location.success and language en not found at Brain.getReply (lib/brain/brain.getReply.js:17:11) at Context.<anonymous> (test/lib/brain/brain.test.js:18:11) at processImmediate (internal/timers.js:461:21)

For 1 and 3, the delay is too long, but why?
For 2, there is a property problem on « Foreach », but I don’t know why.
For 4, there is an error with the label calendar.next-event.get-location.success in the answers file in English, according to what I understood. But I didn’t modify it.

Did I understand the errors correctly?
What should I do to fix these 4 errors?

Thank you for your help.

Hello,

For errors 1 and 3, it works on my machine (maybe it’s too long on yours).
If you want them to pass (just for testing on your side), you can run this command npm run test -- --timeout 3000 (adjust timeout)

For test 2, I think it comes from your questions.en.json file (the field is called Questions instead of questions). It doesn’t find the questions from this file.

For test 4, I’ll let you figure it out after fixing 2 :wink:

No way!!! What a dummy.

Well, I’ll continue.

I did:
npm run test-server timeout 10000
But I get the same result locally.
This must be due to my computer not being powerful enough. I only use it for text processing and internet.

I wasn’t precise enough. You need to go to the server folder and run the command:
npm run test -- --timeout 3000

The first -- indicates that you are passing parameters
The second --timeout 3000 tells mocha to increase the timeout (Mocha | Classic, reliable, trusted. ☕)

Cool, it’s done but I had to set it to 10000 ms to be sure.