Block some subdomains using robots.txt -Angular website with IIS [duplicate]

We have a testing environment with the surprising sub-domain name tests and I would like to block it to search engines.

How can I let Google scan my site and block, but allow

I already read other answers but they were not relevant to me because I don’t use Apache and also this is an Angular website so adding a file in a subdomain won’t help.

Thank you!