Has anyone successfully mocked an external data source for a terraform test?

We have a module which uses an external data source to set count to conditionally provision a resource depending on whether something not owned by Terraform exists.

We need to mock this in order to be able to run some Terraform tests against the module.

I have looked at Tests - Provider Mocking | Terraform | HashiCorp Developer and tried some things, but I’ve not got anything to work yet.

Hoping someone has already done this and can sign post an example.