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

“它"是什么意思?這段代碼中的功能是什么

What does the quot;itquot; function do in this code?(“它是什么意思?這段代碼中的功能是什么?)
本文介紹了“它"是什么意思?這段代碼中的功能是什么?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

問題描述

限時送ChatGPT賬號..

我希望有人可以向我解釋它"在 AngularJS 或純 JavaScript 中的作用(用于)什么(我不確定它是否特定于 Angular).事實證明,這對谷歌來說是一件困難的事情,被命名為它"等等.我已經(jīng)看到它在整個 AngularJS 文檔中使用.我會給你一個來自 ngShow 頁面的例子(它是隱藏/顯示包含大拇指或大拇指向下).

I'm hoping somebody could explain to me what "it" does (is used for) in AngularJS or just plain JavaScript (I'm not sure if it's specific to Angular). This, turns out, is a difficult thing to Google for, being named "it" and all. I've seen it used throughout the AngularJS docs. I'll give you an example from the ngShow page (it's code to hide/show a div containing a thumbs up or thumbs down).

var thumbsUp = element(by.css('span.glyphicon-thumbs-up'));
var thumbsDown = element(by.css('span.glyphicon-thumbs-down'));

it('should check ng-show / ng-hide', function() {
  expect(thumbsUp.isDisplayed()).toBeFalsy();
  expect(thumbsDown.isDisplayed()).toBeTruthy();

  element(by.model('checked')).click();

  expect(thumbsUp.isDisplayed()).toBeTruthy();
  expect(thumbsDown.isDisplayed()).toBeFalsy();
});

推薦答案

參見 Jasmine 測試框架.

it(...) 函數(shù)定義了一個測試用例(又名規(guī)范").

See the Jasmine testing framework.

The it(...) function defines a test case (aka a "spec").

describe("A suite", function() {
  it("contains spec with an expectation", function() {
    expect(true).toBe(true);
  });
});

請注意,AngularJS E2E 測試...

... 使用 Jasmine 作為其測試語法.

... uses Jasmine for its test syntax.

這篇關(guān)于“它"是什么意思?這段代碼中的功能是什么?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

相關(guān)文檔推薦

How can I get my jasmine tests fixtures to load before the javascript considers the document to be quot;readyquot;?(在 javascript 認(rèn)為文檔“準(zhǔn)備好之前,如何讓我的 jasmine 測試裝置加載?) - IT屋-程序員軟件開發(fā)技術(shù)
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 對鏈?zhǔn)椒椒ㄟM(jìn)行單元測試)
How do I inject $rootScope into an AngularJS unit test?(如何將 $rootScope 注入 AngularJS 單元測試?)
Jasmine - How to spy on a function call within a function?(Jasmine - 如何監(jiān)視函數(shù)中的函數(shù)調(diào)用?)
主站蜘蛛池模板: 欧美日高清 | 亚洲精品免费在线观看 | 91一区二区三区在线观看 | h片在线免费看 | 免费色网址 | 精品99久久久久久 | 亚洲精品欧美精品 | 中文字幕日韩欧美一区二区三区 | 人人种亚洲 | 亚洲欧美中文日韩在线v日本 | 精品无码久久久久国产 | 国产一区999 | 亚洲日韩中文字幕一区 | 狠狠操狠狠干 | 国产在线播 | 久草网站 | 黄色毛片网站在线观看 | 开操网 | 欧美激情视频网站 | 国产性网| 久久精品久久综合 | 日韩中文字幕在线观看 | 国产欧美在线 | 日本在线你懂的 | 亚洲一区日韩 | 国产成人免费网站 | 免费一级欧美在线观看视频 | 亚洲精品观看 | 精品成人一区二区 | 99热在线免费 | 91精品国产91久久久久游泳池 | 97久久精品午夜一区二区 | 久一久| 日日夜夜狠狠操 | 婷婷国产一区 | 国产一区二区三区高清 | 亚洲国产精品一区 | 中文字幕电影在线观看 | 精品一区二区视频 | 国产精品区二区三区日本 | 国产精品亚洲综合 |