简体   繁体   English

功能/集成测试NodeJS ReST API实现

[英]Functional/integration testing a NodeJS ReST API implementation

I've built a NodeJS application using mongoose and express. 我使用mongoose和express构建了一个NodeJS应用程序。 This application exposes resources in a ReSTful manner, and I'm trying to build a suite of functional/integraiton tests. 这个应用程序以ReSTful方式公开资源,我正在尝试构建一套功能/集成测试。

This suite, when executed, should fire up my application in an isolated environment (running on localhost is fine), with a custom set of configuration settings (the path to which can be provided as an environment variable). 这个套件在执行时应该在隔离的环境中启动我的应用程序(在localhost上运行很好),并使用一组自定义配置设置(可以作为环境变量提供的路径)。 Any other custom setup actions should be performed. 应执行任何其他自定义设置操作。

After completing the suite of tests, the (mongodb) database should be dropped, and any custom teardown actions should be performed. 完成测试套件后,应删除(mongodb)数据库,并应执行任何自定义拆卸操作。

What are some NodeJS frameworks/modules/etc exist to help achieve this goal? 有哪些NodeJS框架/模块/等可以帮助实现这一目标?

Thanks, Tharsan 谢谢,Tharsan

Mocha可以自己处理测试框架,Tobi或zombi可以进行Web调用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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