Running tests against localstack is faster than the cloud but still far from what we expect from unit tests. And, in my opinion, eventually you will have to run your tests against the real cloud as localstack is probably not 100% compatible.
I have the following approach:
1. Have some integration tests running on a real AWS account with uid in the resource names and good cleanup code. Additionally, I am using aws-nuke from time to time to be sure.
2. Have quite a lot of "unit" tests where I compare Pulumi output to my prepared yamls. I had to write some glue code to achieve that (you can find a part of it here:
https://github.com/pulumi/pulumi/issues/8938). I am using Golang but I think it should be possible in other languages. With this kind of tests, I am covering a lot of cases and also I can develop quite fast as they run in a maximum of a few seconds.
3. I am writing regular unit tests for some algorithms e.g. my cloud resource naming conventions.