The reason you are getting an error is because your unit tests require a running mysql server to connect with, and there is no mysql server running inside your node:latest container at 127.0.0.1
Please note that you cannot connect to mysql using 127.0.0.1 because this is the address of your node:latest container. When using the services feature, you need to connect to the mysql instance using the hostname / service name. This is demonstrated in the above links I provided.
Thanks for your help but node wont connect to my db
Please provide more details. Can you provide a sample of the code you are using to connect? What values are you using to connect? What is the exact error message you received?