Unit testing

Hi, I have little side project I’d like to try in Datomic Cloud / Ions.

I’m struggling to come up with an approach I like re: testing though. I don’t want to unit test in the Cloud, I need to be able to develop without an Internet connection. In general, I just want concentrate on the main idea first locally before pushing to the cloud

I’d use the in-memory db, but it doesn’t support the async client apis? I guess I could shim like https://github.com/ComputeSoftware/datomic-client-memdb for the async api.

Any suggestions? Am I missing something obvious?

Thanks

1 Like

I’ve been thinking through a similar problem: how to structure tests for code that interacts with Datomic Cloud.

The shim you mention above seems to be a common choice.

Alternatively, there is datomic/with and datomic/with-db, which go a long way, provided the code under test doesn’t need to run transact directly.

I just went through this process now. I had a on-prem setup and was really happy about my test setup using midje as shown here: example. Is this the best current approach yet?