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…mehr
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 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
Evan is a JavaScript developer currently enrolled at University of Michigan. He started coding in BASIC when he was 6 years old. In high school, he was the webmaster of his high school's online newspaper, where he learned how to make more of a real website (PHP, mySQL, JavaScript, jQuery). He most recently worked at UniversityNow, an educational startup in Palo Alto.
Inhaltsangabe
Preface Who Should Read This Book Conventions Used in This Book Using Code Examples Safari® Books Online How to Contact Us Acknowledgments Chapter 1: Intro to Testing 1.1 What Is Software Testing? 1.2 Why Is It Useful? 1.3 Test-Driven Development 1.4 Behavior-Driven Development Chapter 2: Jasmine 2.1 What Is Jasmine? 2.2 Getting Set Up with Jasmine 2.3 Testing Existing Code with describe, it, and expect 2.4 Matchers 2.5 Writing the Tests First with Test-Driven Development Chapter 3: Writing Good Tests 3.1 Cardinal Rule: When in Doubt, Test 3.2 Test Components 3.3 Black-Box Testing Chapter 4: Matchers in Depth 4.1 Equality: toEqual 4.2 Identity: toBe 4.3 Yes or No? toBeTruthy, toBeFalsy 4.4 Negate Other Matchers with not 4.5 Check If an Element Is Present with toContain 4.6 Is It Defined? toBeDefined, toBeUndefined 4.7 Nullness: toBeNull 4.8 Is It NaN? toBeNaN 4.9 Comparators: toBeGreaterThan, toBeLessThan 4.10 Nearness: toBeCloseTo 4.11 Using toMatch with Regular Expressions 4.12 Checking If a Function Throws an Error with toThrow 4.13 Custom Matchers Chapter 5: More Jasmine Features 5.1 Before and After 5.2 Nested Suites 5.3 Skipping Specs and Suites 5.4 Matching Class Names Chapter 6: Spies 6.1 The Basics: Spying on a Function 6.2 Calling Through: Making Your Spy Even Smarter 6.3 Making Sure a Spy Returns a Specific Value 6.4 Replacing a Function with a Completely Different Spy 6.5 Creating a New Spy Function 6.6 Creating a New Spy Object Chapter 7: Using Jasmine with Other Tools 7.1 Jasmine and CoffeeScript 7.2 Jasmine and Node.js 7.3 Jasmine and Ruby on Rails 7.4 Jasmine with Non-Rails Ruby 7.5 More Tools Chapter 8: Reference 8.1 Jasmine on the Web 8.2 The Basic Structure of a Suite 8.3 Matchers Reference 8.4 List of Falsy Values 8.5 Reserved Words in Jasmine Colophon
Preface Who Should Read This Book Conventions Used in This Book Using Code Examples Safari® Books Online How to Contact Us Acknowledgments Chapter 1: Intro to Testing 1.1 What Is Software Testing? 1.2 Why Is It Useful? 1.3 Test-Driven Development 1.4 Behavior-Driven Development Chapter 2: Jasmine 2.1 What Is Jasmine? 2.2 Getting Set Up with Jasmine 2.3 Testing Existing Code with describe, it, and expect 2.4 Matchers 2.5 Writing the Tests First with Test-Driven Development Chapter 3: Writing Good Tests 3.1 Cardinal Rule: When in Doubt, Test 3.2 Test Components 3.3 Black-Box Testing Chapter 4: Matchers in Depth 4.1 Equality: toEqual 4.2 Identity: toBe 4.3 Yes or No? toBeTruthy, toBeFalsy 4.4 Negate Other Matchers with not 4.5 Check If an Element Is Present with toContain 4.6 Is It Defined? toBeDefined, toBeUndefined 4.7 Nullness: toBeNull 4.8 Is It NaN? toBeNaN 4.9 Comparators: toBeGreaterThan, toBeLessThan 4.10 Nearness: toBeCloseTo 4.11 Using toMatch with Regular Expressions 4.12 Checking If a Function Throws an Error with toThrow 4.13 Custom Matchers Chapter 5: More Jasmine Features 5.1 Before and After 5.2 Nested Suites 5.3 Skipping Specs and Suites 5.4 Matching Class Names Chapter 6: Spies 6.1 The Basics: Spying on a Function 6.2 Calling Through: Making Your Spy Even Smarter 6.3 Making Sure a Spy Returns a Specific Value 6.4 Replacing a Function with a Completely Different Spy 6.5 Creating a New Spy Function 6.6 Creating a New Spy Object Chapter 7: Using Jasmine with Other Tools 7.1 Jasmine and CoffeeScript 7.2 Jasmine and Node.js 7.3 Jasmine and Ruby on Rails 7.4 Jasmine with Non-Rails Ruby 7.5 More Tools Chapter 8: Reference 8.1 Jasmine on the Web 8.2 The Basic Structure of a Suite 8.3 Matchers Reference 8.4 List of Falsy Values 8.5 Reserved Words in Jasmine Colophon
Es gelten unsere Allgemeinen Geschäftsbedingungen: www.buecher.de/agb
Impressum
www.buecher.de ist ein Shop der buecher.de GmbH & Co. KG Bürgermeister-Wegele-Str. 12, 86167 Augsburg Amtsgericht Augsburg HRA 13309