tailieunhanh - JavaScript Testing with Jasmine

What Is Jasmine? Getting Set Up with Jasmine Testing Existing Code with describe, it, and expect An Example to Test Jasmine Time! Matchers Writing the Tests First with Test-Driven Development Cardinal Rule: When in Doubt, Test Test Components Black-Box Testing Equality: toEqual Identity: toBe Yes or No? toBeTruthy, toBeFalsy Negate Other Matchers with not Check If an Element Is Present with toContain Is It Defined? toBeDefined, toBeUndefined | JavaScript Testing with Jasmine Evan Hahn O REILLY Beijing Cambridge Farnham Kôln Sebastopol Tokyo JavaScript Testing with Jasmine by Evan Hahn Copyright 2013 Evan Hahn. All rights reserved. Printed in the United States of America. Published by O Reilly Media Inc. 1005 Gravenstein Highway North Sebastopol CA 95472. O Reilly books may be purchased for educational business or sales promotional use. Online editions are also available for most titles http . For more information contact our corporate institutional sales department 800-998-9938 or corporate@. Editor Mary Treseler Production Editor Marisa LaFleur Proofreader Rachel Monaghan Cover Designer Karen Montgomery Interior Designer David Futato Illustrator Rebecca Demarest March 2013 First Edition Revision History for the First Edition 2013-03-22 First release See http catalog isbn 9781449356378 for release details. Nutshell Handbook the Nutshell Handbook logo and the O Reilly logo are registered trademarks of O Reilly Media Inc. JavaScript Testing with Jasmine_ the image of a phoebe and related trade dress are trademarks of O Reilly Media Inc. Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book and O Reilly Media Inc. was aware of a trademark claim the designations have been printed in caps or initial caps. While every precaution has been taken in the preparation of this book the publisher and author assume no responsibility for errors or omissions or for damages resulting from the use of the information contained herein. ISBN 978-1-449-35637-8 LSI Table of Contents 1. Intro to What Is Software Testing 1 Why Is It Useful 2 Test-Driven Development 2 Behavior-Driven Development 2 2. Jasmine. 5 What Is Jasmine 5 Getting Set Up with Jasmine 5 Testing Existing Code with describe it and expect 6 .