简体   繁体   中英

How to do testing using cassandra in my nodejs application?

I am working on a nodejs application. The database used is cassandra. We are using https://www.npmjs.com/package/dse-driver .

I am trying to understand how to write tests for the application. I am specifically confused about how to keep my test database separate from development database. Can we create and destroy test databases on the fly like Django? How are test cases for cassandra and nodejs written? What are the best practices for the same?

You can create a testkeyspace where you initially set up all the tables before each test and drop it afterwards. If you do so, you should keep in mind, that after truncating tables, there are still snapshots on the filesystem. You probably would want to setup a cleanup job.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM