Need advice about which tool to choose?询问Stacks亚博提现规则hare社区!

Jest

3.4K.
2.3K
+1
161.
Mocha

3.5K.
2.5K
+1
4.20.
Add tool

Jest vs Mocha: What are the differences?

Testing frameworks are the backbone of testing the code you have worked hard on. A good testing framework allows testing the client-side code. Two popular contenders are Jest and Mocha.Jest是一个开源测试框架由Facebook. Built into the popular create-react-app package, is faster and smoother to write idiomatic JavaScript tests. It has built-in mocking and assertion abilities while running tests in parallel, providing a smoother, faster test-run. One unique feature of Jest is it provides Snapshot testing for complete control over UI.Mochaprovides developers with a base test framework, with options such as assertion, mocking, and spy libraries. It is one of the most flexible JavaScript testing libraries. The slight downside to Mocha is the additional setup and configuration required. Chai, the most popular open-source assertion library is used with Mocha.

Decisions about Jest and Mocha
Shared insights
on
Jest

As we all know testing is an important part of any application. To assist with our testing we are going to use bothandJest. We feel these tools complement each other and will help us get good coverage of our code. We will use Cypress for our end to end testing as we've found it quite user friendly. Jest will be used for our unit tests because we've seen how many larger companies use it with great success.

查看更多

邮递员将用于使用我们创建的后端API进行集成测试。它提供了一个干净的界面来创建许多请求,甚至可以将这些请求组织成集合。它有助于首先测试后端API,以确保在前端使用它之前工作。jest也可用于测试,已经嵌入反应。它不仅在JavaScript中提供单元测试支持,它也可以对前端进行快照测试,以确保组件正常呈现。酶与JEST互补,提供更多功能,如浅层渲染。unittest将用于Python测试,因为它很简单,有很多功能,并且已经内置了Python。Sentry将用于跟踪错误,因为它也很容易与Heroku相容,因为它们将其作为附加组件提供。LogDNA将用于跟踪不是错误的日志,也是Heroku附加组件。它很好地在实时录制日志,监视,轨道甚至修复错误,所以我们的应用程序可以更顺畅地运行。

查看更多

我们使用Mocha进行FDA验证测试。它集成到我们上游的Web应用程序框架中。我们喜欢如何进行测试,它的“语法”是记者的选择,以及无数其他功能。大多数人都可以同意摩卡,并通过我们的FDA验证和验证(V&V)测试策略来实现我们的中途。

查看更多
使用私人Stackshare获取贵公司开发人员的建议。亚博提现规则 注册私人堆栈。亚博提现规则
www.yabo.la
笑话
Pros of Mocha
  • 33.
    Open source
  • 30.
    Mock by default makes testing much simpler
  • 21.
    测试React Native Apps
  • 18.
    并行测试运行
  • 14.
    快速地
  • 13.
    Bundled with JSDOM to enable DOM testing
  • 7.
    默认拧紧您的课程,断开测试
  • 7.
    开箱代码覆盖范围
  • 6.
    Promise support
  • 6.
    One stop shop for unit testing
  • 3.
    伟大的文件
  • 1
    Built in watch option with interactive filtering menu
  • 1
    Assert Library Included
  • 1
    预设支持
  • 0.
    可用于BDD
  • 135.
    Open source
  • 10.0.
    简单的
  • 81
    Promise support
  • 47.
    灵活的
  • 28.
    易于为生成器添加支持
  • 11.
    For browser and server testing
  • 6.
    Curstom assertion libraries
  • 4.
    Works with Karma
  • 3.
    没有其他更好的工具
  • 1
    简单的设置
  • 1
    适用于萨索克莱斯
  • 1
    简单的集成测试
  • 1
    许多教程和在线帮助
  • 1
    与buxberstack一起使用

Sign up to add or upvote pros提出明智的产品决策

Cons of Jest
Cons of Mocha
  • 2
    Many bugs still not fixed months/years after reporting
  • 2
    同一错误的多个错误消息
  • 2
    文件
  • 2
    模糊配置
  • 1
    坏文档
  • 1
    模糊的
  • 1
    本身仍然不支持.mjs文件
  • 1
    Can't fail beforeAll to abort tests
  • 1
    Difficult to run single test/describe/file
  • 1
    BeforeAll timing out makes all passing tests fail
  • 1
    Bugged
  • 1
    不稳定
  • 1
    Difficult
  • 0.
    与终端上的监视模式交互
  • 3.
    没有断言无法测试有备用功能
  • 1
    No assertion count in results

注册添加或升高缺点提出明智的产品决策

What is Jest?

Jest provides you with multiple layers on top of Jasmine.

什么是摩卡?

摩卡是一个功能丰富的JavaScript测试框架running on node.js and the browser, making asynchronous testing simple and fun. Mocha tests run serially, allowing for flexible and accurate reporting, while mapping uncaught exceptions to the correct test cases.

Need advice about which tool to choose?询问Stacks亚博提现规则hare社区!

What companies use Jest?
What companies use Mocha?
查看您公司内部的哪些团队正在使用Jest或Mocha。
注册私人堆栈亚博提现规则 www.yabo.la

注册以满足所有公司提出明智的产品决策

什么工具与jest集成?
What tools integrate with Mocha?

注册以完全访问所有工具集成提出明智的产品决策

Blog Posts

2019年7月23日晚上10:44

CircleCI

+32.
17.
4.565
Jun 19 2018 at 3:02AM

Stream

+29.
15.
10.947
2016年8月5日凌晨4:07

毛刺

+33.
20.
16.0.6.
What are some alternatives to Jest and Mocha?
Selenium
Selenium automates browsers. That's it! What you do with that power is entirely up to you. Primarily, it is for automating web applications for testing purposes, but is certainly not limited to just that. Boring web-based administration tasks can (and should!) also be automated as well.
Ava.
尽管JavaScript是单线程,但由于其异步性质,Node.js中的IO可以并行地发生。AVA利用此功能并同时运行测试,这对IO重测试特别有利。此外,测试文件并行运行为单独的进程,为每个测试文件提供更好的性能和孤立的环境。
Enzyme
Enzyme is a JavaScript Testing utility for React that makes it easier to assert, manipulate, and traverse your React Components' output.
茉莉花
茉莉花is a Behavior Driven Development testing framework for JavaScript. It does not rely on browsers, DOM, or any JavaScript framework. Thus it's suited for websites, Node.js projects, or anywhere that JavaScript can run.
柏is a front end automated testing application created for the modern web. Cypress is built on a new architecture and runs in the same run-loop as the application being tested. As a result Cypress provides better, faster, and more reliable testing for anything that runs in a browser. Cypress works on any front-end framework or website.
See all alternatives
jest and mocha的评论
.Net Developer Hexacta.
Review of
Jest

我在Vue JS项目中使用了3个月的Jest。我需要在jest文档中使用大量的自定义主题搜索,因为它不清楚。这些例子也很差。

开发人员如何使用Jest和Mocha
Volkan Özçelik uses
Jest

Jest is my unit-testing tool of choice.

几乎所有单元测试套件(Mocha,Jasmine等)或多或少相同。

The main advantage I guess, is that it integrates pretty well with React and Enzyme.

Kang Hyeon Ku使用
Mocha

javascript테스트를위해써프레임워크이다。JUNIT에게에게HAMCRETT이있다면MOCHA에게는柴가있다。

Dave Woolfenden uses
Mocha

Is a feature-rich JavaScript test framework running on Node.js and in the browser supporting asynchronous testing.

Kingsley Victor使用
Mocha

Mocha is ideal for running tests on apis built with Node's Express

Tim De Lange uses
Mocha

Unit testing on shared code between brow ser and back end.

Coolfront Technologies uses
Mocha

Testing for our Coolfront Mobile product