وبلاگ بلیان

JavaScript Testing with Jasmine: JavaScript Behavior-Driven Development

معرفی کتاب «JavaScript Testing with Jasmine: JavaScript Behavior-Driven Development» نوشتهٔ Evan Hahn، منتشرشده توسط نشر O'Reilly Media در سال 2013. این کتاب در فرمت pdf، زبان انگلیسی ارائه شده است. «JavaScript Testing with Jasmine: JavaScript Behavior-Driven Development» در دستهٔ بدون دسته‌بندی قرار دارد.

Get a concise introduction to Jasmine, the popular behavior-driven testing framework for JavaScript. This practical guide shows you how to write unit tests with Jasmine that automatically check for bugs in your application. Learn how to write specifications for individual components, and then use those specs to test the code you write. Throughout the book, author Evan Hahn focuses primarily on methods for testing browser-based JavaScript applications, but you’ll also discover how to use Jasmine with CoffeeScript, Node.js, Ruby on Rails, and Ruby without Rails. You won’t find a more in-depth source for Jasmine anywhere.* Get an overview of both test-driven and behavior-driven development * Write useful specs by determining what you need to test—and what you don’t * Test the behavior of new and existing code against the specs you create * Apply Jasmine matchers and discover how to build your own * Organize code suites into groups and subgroups as your code becomes more complex * Use a Jasmine spy in place of a function or an object—and learn why it’s valuable Copyright 2 Table of Contents 3 Preface 5 Who Should Read This Book 5 Conventions Used in This Book 5 Using Code Examples 6 Safari® Books Online 6 How to Contact Us 7 Acknowledgments 7 Chapter 1. Intro to Testing 9 What Is Software Testing? 9 Why Is It Useful? 10 Test-Driven Development 10 Behavior-Driven Development 10 Chapter 2. Jasmine 13 What Is Jasmine? 13 Getting Set Up with Jasmine 13 Testing Existing Code with describe, it, and expect 14 An Example to Test 14 Jasmine Time! 15 Matchers 16 Writing the Tests First with Test-Driven Development 17 Chapter 3. Writing Good Tests 21 Cardinal Rule: When in Doubt, Test 21 Test Components 21 Black-Box Testing 22 Chapter 4. Matchers in Depth 23 Equality: toEqual 23 Identity: toBe 23 Yes or No? toBeTruthy, toBeFalsy 24 Negate Other Matchers with not 25 Check If an Element Is Present with toContain 25 Is It Defined? toBeDefined, toBeUndefined 26 Nullness: toBeNull 26 Is It NaN? toBeNaN 26 Comparators: toBeGreaterThan, toBeLessThan 27 Nearness: toBeCloseTo 27 Using toMatch with Regular Expressions 28 Checking If a Function Throws an Error with toThrow 28 Custom Matchers 28 Chapter 5. More Jasmine Features 31 Before and After 31 Nested Suites 32 Skipping Specs and Suites 32 Matching Class Names 33 Chapter 6. Spies 35 The Basics: Spying on a Function 35 Calling Through: Making Your Spy Even Smarter 37 Making Sure a Spy Returns a Specific Value 38 Replacing a Function with a Completely Different Spy 38 Creating a New Spy Function 38 Creating a New Spy Object 39 Chapter 7. Using Jasmine with Other Tools 41 Jasmine and CoffeeScript 41 Jasmine and Node.js 42 Installing jasmine-node on Unix and Linux 42 Installing jasmine-node on Windows 42 Basic Usage 42 Asynchronous Tests with jasmine-node 43 jasmine-node and CoffeeScript 43 Jasmine and Ruby on Rails 44 Installation 44 Usage 44 Jasmine with Non-Rails Ruby 45 More Tools 45 Chapter 8. Reference 47 Jasmine on the Web 47 The Basic Structure of a Suite 47 Matchers Reference 48 List of Falsy Values 48 Reserved Words in Jasmine 48 About the Author 50 Get a concise introduction to Jasmine, the popular behavior-driven testing framework for JavaScript. This practical guide shows you how to write unit tests with Jasmine that automatically check for bugs in your application. If you have JavaScript experience—with knowledge of some advanced features—you’ll learn how to write specifications for individual components, and then use those specs to test the code you write.Throughout the book, author Evan Hahn focuses primarily on methods for testing browser-based JavaScript applications, but you’ll also discover how to use Jasmine with CoffeeScript, Node.js, Ruby on Rails, and Ruby without Rails. You won’t find a more in-depth source for Jasmine anywhere.Get an overview of both test-driven and behavior-driven developmentWrite useful specs by determining what you need to test—and what you don’tTest the behavior of new and existing code against the specs you createApply Jasmine matchers and discover how to build your ownOrganize code suites into groups and subgroups as your code becomes more complexUse a Jasmine spy in place of a function or an object—and learn why it’s valuable Get a concise introduction to Jasmine, the popular behavior-driven testing framework for JavaScript. This practical guide shows you how to write unit tests with Jasmine that automatically check for bugs in your application. If you have JavaScript experiencewith knowledge of some advanced featuresyoull learn how to write specifications for individual components, and then use those specs to test the code you write. Throughout the book, author Evan Hahn focuses primarily on methods for testing browser-based JavaScript applications, but youll also discover how to use Jasmine with CoffeeScript, Node.js, Ruby on Rails, and Ruby without Rails. You wont find a more in-depth source for Jasmine anywhere.
دانلود کتاب JavaScript Testing with Jasmine: JavaScript Behavior-Driven Development