Yes, I first put this code in a setTimeOut block but then the tests doen't work.
This is a first draft, I will improve it when I'll have time ;)