上一页 1 ··· 446 447 448 449 450 451 452 453 454 ··· 497 下一页
摘要: When you render a component with the Shallow Renderer, you have access to the underlying object. We can write lots of useful tests to check that our c... 阅读全文
posted @ 2016-01-05 02:26 Zhentiw 阅读(287) 评论(0) 推荐(0)
摘要: When writing React component tests, it can be hard to decipher the error diffs of broken tests, since they are just the final objects that React uses ... 阅读全文
posted @ 2016-01-05 01:54 Zhentiw 阅读(300) 评论(0) 推荐(0)
摘要: In this lesson, we walk through how to use one of React's Test Utilities (from thereact-addons-test-utilspackage) called "Shallow Rendering". This let... 阅读全文
posted @ 2016-01-05 01:23 Zhentiw 阅读(357) 评论(0) 推荐(0)
摘要: JSON(JavaScript Object Notation) is a standard method to serialize JavaScript objects and is commonly used to transfer data from the server to the bro... 阅读全文
posted @ 2016-01-04 04:18 Zhentiw 阅读(324) 评论(0) 推荐(0)
摘要: To write tests for our React code, we need to first install some libraries for running tests and writing assertions. In this lesson we walk through se... 阅读全文
posted @ 2016-01-04 03:59 Zhentiw 阅读(308) 评论(0) 推荐(0)
摘要: We can use the destructing and rest parameters at the same time when dealing with Array opration.Example 1:let [first, ...remainingUsers] = ["Sam", "T... 阅读全文
posted @ 2016-01-04 03:21 Zhentiw 阅读(398) 评论(0) 推荐(0)
摘要: function spinner(target, options = {}){ let defaults = { message: "Please wait", spinningSpeed: 5, cssClass: ".is-spinning" }; let setting... 阅读全文
posted @ 2016-01-03 17:09 Zhentiw 阅读(469) 评论(0) 推荐(0)
摘要: Creating Object:Example 1:let name = "Brook";let totalReplies = 249;let avatar = "/users/avatars/brook-user-1.jpg";let user = {name, totalReplies, ava... 阅读全文
posted @ 2016-01-03 16:53 Zhentiw 阅读(266) 评论(0) 推荐(0)
摘要: The spread operator allow us to split an Array arguement into individual elements.getRequest("/topics/17/tags", function(data){ let tags = data.tag... 阅读全文
posted @ 2016-01-03 16:32 Zhentiw 阅读(187) 评论(0) 推荐(0)
摘要: Problem with the ES5:function displayTags(){ for (let i in arguments) { let tag = arguments[i]; _addToTopic(tag); }}Hard to tell w... 阅读全文
posted @ 2016-01-02 21:47 Zhentiw 阅读(267) 评论(0) 推荐(0)
上一页 1 ··· 446 447 448 449 450 451 452 453 454 ··· 497 下一页