TAILIEUCHUNG - Test Driven JavaScript Development- P23

Test Driven JavaScript Development- P23:This book is about programming JavaScript for the real world, using the techniques and workflow suggested by Test-Driven Development. It is about gaining confidence in your code through test coverage, and gaining the ability to fearlessly refactor and organically evolve your code base. It is about writing modular and testable code. It is about writing JavaScript that works in a wide variety of environments and that doesn’t get in your user’s way. | The Final Chat Client 433 Listing Expecting the message form to clear message test should clear form after publish function var el input 0 NP A vision of misery assertEquals Ideally we would not clear the form until we know for sure the message was sent. Unfortunately the cometClient does not support adding a success callback at this point so the best we can do is clearing it immediately after having sent it and hope for the best. The proper fix would include adding a third options argument to cometClient and wait for success. Listing shows the message form controller s updated handleSubmit. Listing Clearing the message after publishing it function handleSubmit event . It would also be nice if the message form gave focus to the input field immediately upon initializing it. I will leave doing so as an exercise. Notes on Deployment Copy over the message form and message list controllers to chapp s public directory and reload your browser. The application should now be slightly smoother to use. Simply copying files to deploy them is cumbersome and error prone. Additionally serving the application with 15 individual script files is not optimal for performance. If you installed Ruby and RubyGems to use the jstestdriver and jsautotest tools in Chapter 3 Tools of the Trade then you have a JavaScript and CSS concatenator and minifier at your fingertips. Listing shows the three required commands to install Juicer which will conveniently package your scripts for deployment. Please purchase PDF Split-Merge on to remove this watermark. From the Library of 434 TDD and DOM Manipulation The Chat Client Listing Installing Juicer and YUI Compressor gem install juicer juicer install yui_compressor Run from the root of the application the command in Listing will produce a single file .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.