久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

Jest和酶有什么區別?

What is the difference between Jest and enzyme?(Jest和酶有什么區別?)
本文介紹了Jest和酶有什么區別?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

限時送ChatGPT賬號..

我是單元測試的新手.我想測試 React 項目.當我開始使用 React 文檔時,將酶稱為測試實用程序,這對我來說有點模棱兩可.

I'm new to Unit testing. I want to test React project. As I started with React documentation which refers to enzyme as test utility which is kind of ambiguous to me.

Jestenzyme有什么區別?

  • enzyme斷言庫還是任務運行器?
  • 我可以將 karmaJasmine 一起使用嗎?
  • 測試 react-redux 項目的最佳方法是什么?
  • Is enzyme assertion library or task runner?
  • Can I use karma with Jasmine?
  • What is the best way to test a react-redux project?

推薦答案

Jest 是一個包含任務運行器、斷言庫和模擬支持的框架.這意味著它可以執行不同的單元測試用例,將其結果寫入控制臺或日志文件,創建模擬或驗證所有斷言.簡而言之,它將執行測試.

Jest is a framework which includes a task runner, assertion library, and mocking support. This means it can execute different unit test cases, write its result in console or log files, create mocks, or verify all the assertions. In short, it will execute the test.

Enzyme 是一個為編寫單元測試提供簡單接口的庫.為此,它封裝了 React TestUtils、JSDOM 和 CheerIO 等包.React TestUtils 具有將 React 組件渲染到文檔中并模擬事件的方法.JSDOM 是 DOM(文檔對象模型)的 JavaScript 實現.DOM 表示 UI 組件的樹結構.CheerIO 實現了 jQuery 核心的一個子集,用于查詢 DOM.

Enzyme, on other hand, is a library that provides a simple interface for writing unit tests. For this purpose, it wraps packages such as React TestUtils, JSDOM and CheerIO. React TestUtils has methods to render a React component into a document and to simulate an event. JSDOM is a JavaScript implementation of the DOM (Document object model). The DOM represents the tree structure of UI components. CheerIO implements a subset of jQuery core and is used to query the DOM.

Enzyme 不是測試運行器.它沒有自己的斷言庫.它只是提供了一組用于單元測試的 API.這就是它可以與 Jest 或任何其他任務運行程序集成的原因.

Enzyme is not a test runner. It doesn't have its own assertion library. It just provides a collection of APIs for unit testing. That's why it could be integrated with Jest or any other task runner.

是的,你可以在茉莉花上使用因果報應.

Yes, you can use karma with jasmine.

這篇關于Jest和酶有什么區別?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

How can I get my jasmine tests fixtures to load before the javascript considers the document to be quot;readyquot;?(在 javascript 認為文檔“準備好之前,如何讓我的 jasmine 測試裝置加載?) - IT屋-程序員軟件開發技術
What do jasmine runs and waitsFor actually do?(jasmine 運行和等待實際上是做什么的?)
How to provide mock files to change event of lt;input type=#39;file#39;gt; for unit testing(如何提供模擬文件來更改 lt;input type=filegt; 的事件用于單元測試)
How to unit test a chained method using Jasmine(如何使用 Jasmine 對鏈式方法進行單元測試)
How do I inject $rootScope into an AngularJS unit test?(如何將 $rootScope 注入 AngularJS 單元測試?)
Jasmine - How to spy on a function call within a function?(Jasmine - 如何監視函數中的函數調用?)
主站蜘蛛池模板: 久久精品视频在线播放 | 免费毛片网 | 欧美视频一级 | 久久久久国产一区二区三区四区 | 影音先锋中文在线 | 国产成人精品久久二区二区91 | 国产精品免费一区二区三区四区 | 天天干天天爱天天 | 操一草| 国产精品久久久久久久久久 | 三a毛片| 国产综合网址 | 国产成人综合网 | 成人h电影在线观看 | 久久新| 巨大荫蒂视频欧美另类大 | 91p在线观看 | 亚洲精品电影在线观看 | 亚洲欧美在线视频 | 亚洲一区二区三区在线播放 | 午夜精品久久久久久久久久久久久 | 国产精品一区二区三区在线 | 视频一区中文字幕 | 午夜电影网址 | 亚洲视频一区二区三区 | www.国产.com| 亚洲国产一区视频 | 亚洲高清在线 | 亚洲一区二区三区高清 | 欧美精品一区二区三区视频 | 久久久成人精品 | 久久久婷婷 | 免费同性女女aaa免费网站 | 国产精品国产精品国产专区不片 | 亚洲一区二区三区视频在线 | 999久久久久久久久 国产欧美在线观看 | 欧美一区二区大片 | 精品久久久久久 | 国产乱码精品一品二品 | 91久久精品国产91久久性色tv | 在线国产视频 |