与Node.js一起使用的最佳测试框架是什么? [英] What is the best testing framework to use with Node.js?

查看:49
本文介绍了与Node.js一起使用的最佳测试框架是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 https://github.com/ry/node上查看了相当长的测试框架列表/wiki/modules#testing .这些框架有什么经验?

I have looked at the rather long list of testing frameworks at https://github.com/ry/node/wiki/modules#testing. What is the experience with these frameworks?

显然,在浏览器中运行的能力将是一个很大的好处,但是我主要对Node.js感兴趣.具有高度异步倾向的东西会很棒.

Obviously the ability to run in the browser would be a big bonus, but I'm mainly interested in Node.js. Something with a heavily asynchronous slant would be great.

推荐答案

更新:

摩卡是最好的.

这些框架有什么经验?

What is the experience with these frameworks?

我玩过 expresso ,它是一个非常酷的测试框架,也具有测试覆盖率.它是由TJ Holowaychuk创建的,他也是 Express.js 的创建者(和小型)基于Node.js和Connect构建的服务器端JavaScript Web开发框架).我最近看到他还有一个很酷的库,叫做 should.js ,可以与Expresso一起使用以获得更好的测试体验.

I played with expresso which is pretty cool testing framework which also has test-coverage. It has been created by TJ Holowaychuk who is also the creator of Express.js (insanely fast (and small) server-side JavaScript web development framework built on Node.js and Connect). I recently saw that he also has a cool library called should.js which can be used together with Expresso for a even better testing experience.

很明显,在 浏览器将是一个很大的奖励

Obviously, the ability to run in the browser would be a big bonus

我不认为它可以在浏览器中运行,但是我也不明白为什么要在浏览器中运行它?

I don't believe it can run in the browser, but I also don't get why you would want to run it inside the browser?

但是我主要对Node.js感兴趣. 高度异步的东西 倾斜会很棒.

but I'm mainly interested in Node.js. Something with a heavily asynchronous slant would be great.

名言录:

传递给每个回调的参数 是beforeExit,通常使用 断言回调已经 调用.

The argument passed to each callback is beforeExit, which is typically used to assert that callbacks have been invoked.

您可以使用beforeExit测试异步功能.

You can use beforeExit to test asynchronous functions.

提示:在 TJ Holowaychuk en.wikipedia.org/wiki/GitHub"rel =" noreferrer> GitHub ,因为他创建了非常好的开源代码.

TIP: Follow TJ Holowaychuk on GitHub, because he creates very good open-source code.

这篇关于与Node.js一起使用的最佳测试框架是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆