# Questions for developers

**URL:** <https://community.gladysassistant.com/t/questions-pour-les-developpeurs/5825>\
**Category:** Développement\
**Created:** [December 1, 2020, 8:51pm UTC](https://community.gladysassistant.com/t/questions-pour-les-developpeurs/5825 "2020-12-01T20:51:55Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tlse-vins](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/tlse-vins/32/6054_2.png) [@Tlse-vins](https://community.gladysassistant.com/u/Tlse-vins)\
**Post date:** [December 1, 2020, 8:51pm UTC](https://community.gladysassistant.com/t/questions-pour-les-developpeurs/5825/1 "2020-12-01T20:51:56Z")

</div>

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 «&nbsp;Foreach&nbsp;», 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.

---

<div class="post-metadata">

**Author:** ![cicoub13](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/cicoub13/32/4482_2.png) [@cicoub13](https://community.gladysassistant.com/u/cicoub13)\
**Post date:** [December 1, 2020, 9:42pm UTC](https://community.gladysassistant.com/t/questions-pour-les-developpeurs/5825/2 "2020-12-01T21:42:35Z")

</div>

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 😉

---

<div class="post-metadata">

**Author:** ![Tlse-vins](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/tlse-vins/32/6054_2.png) [@Tlse-vins](https://community.gladysassistant.com/u/Tlse-vins)\
**Post date:** [December 2, 2020, 8:46am UTC](https://community.gladysassistant.com/t/questions-pour-les-developpeurs/5825/3 "2020-12-02T08:46:33Z")

</div>

> [@cicoub13](#):
>
> For test 2, I think it’s coming from your questions.en.json file (the field is called `Questions` instead of `questions`). It doesn’t find the `questions` in this file.

No way!!! What a dummy.

Well, I’ll continue.

---

<div class="post-metadata">

**Author:** ![Tlse-vins](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/tlse-vins/32/6054_2.png) [@Tlse-vins](https://community.gladysassistant.com/u/Tlse-vins)\
**Post date:** [December 2, 2020, 10:09am UTC](https://community.gladysassistant.com/t/questions-pour-les-developpeurs/5825/4 "2020-12-02T10:09:00Z")

</div>

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.

> **[Test Asus T101HA : un portable 2-en-1 pas cher](https://www.lesnumeriques.com/ordinateur-portable/asus-t101ha-gr005t-p35565/test.html)**
>
> L'Asus Transformer Book T101HA est un petit ordinateur 2-en-1 dont le prix attractif (350 € pour notre version d'essai) le place sur l’entrée de gamme. Cette tablette de 10” sous Windows 10 avec clavier détachable a-t-elle ce qu’il faut pour nous...

---

<div class="post-metadata">

**Author:** ![cicoub13](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/cicoub13/32/4482_2.png) [@cicoub13](https://community.gladysassistant.com/u/cicoub13)\
**Post date:** [December 2, 2020, 11:04am UTC](https://community.gladysassistant.com/t/questions-pour-les-developpeurs/5825/5 "2020-12-02T11:04:50Z")

</div>

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. ☕](https://mochajs.org/#command-line-usage))

---

<div class="post-metadata">

**Author:** ![Tlse-vins](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/tlse-vins/32/6054_2.png) [@Tlse-vins](https://community.gladysassistant.com/u/Tlse-vins)\
**Post date:** [December 2, 2020, 12:00pm UTC](https://community.gladysassistant.com/t/questions-pour-les-developpeurs/5825/6 "2020-12-02T12:00:34Z")

</div>

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