• Complain

Evan Hahn - JavaScript Testing with Jasmine: JavaScript Behavior-Driven Development

Here you can read online Evan Hahn - JavaScript Testing with Jasmine: JavaScript Behavior-Driven Development full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. year: 2013, publisher: OReilly Media, genre: Computer. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:

Romance novel Science fiction Adventure Detective Science History Home and family Prose Art Politics Computer Non-fiction Religion Business Children Humor

Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.

Evan Hahn JavaScript Testing with Jasmine: JavaScript Behavior-Driven Development
  • Book:
    JavaScript Testing with Jasmine: JavaScript Behavior-Driven Development
  • Author:
  • Publisher:
    OReilly Media
  • Genre:
  • Year:
    2013
  • Rating:
    3 / 5
  • Favourites:
    Add to favourites
  • Your mark:
    • 60
    • 1
    • 2
    • 3
    • 4
    • 5

JavaScript Testing with Jasmine: JavaScript Behavior-Driven Development: summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "JavaScript Testing with Jasmine: JavaScript Behavior-Driven Development" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

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 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.Get an overview of both test-driven and behavior-driven development Write useful specs by determining what you need to testand what you dont 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 objectand learn why its valuable

Evan Hahn: author's other books


Who wrote JavaScript Testing with Jasmine: JavaScript Behavior-Driven Development? Find out the surname, the name of the author of the book and a list of all author's works by series.

JavaScript Testing with Jasmine: JavaScript Behavior-Driven Development — read online for free the complete book (whole text) full work

Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "JavaScript Testing with Jasmine: JavaScript Behavior-Driven Development" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.

Light

Font size:

Reset

Interval:

Bookmark:

Make
JavaScript Testing with Jasmine
Evan Hahn
Beijing Cambridge Farnham Kln Sebastopol Tokyo Download from Wow eBook - photo 1

Beijing Cambridge Farnham Kln Sebastopol Tokyo
Download from Wow! eBook

Special Upgrade Offer

If you purchased this ebook directly from oreilly.com, you have the following benefits:

  • DRM-free ebooksuse your ebooks across devices without restrictions or limitations

  • Multiple formatsuse on your laptop, tablet, or phone

  • Lifetime access, with free updates

  • Dropbox syncingyour files, anywhere

If you purchased this ebook from another retailer, you can upgrade your ebook to take advantage of all these benefits for just $4.99. to access your ebook upgrade.

Please note that upgrade offers are not available from sample content.

Preface

All programmers want their code to work the way they intended. Jasmine, a popular testing framework for the JavaScript programming language, allows you to achieve that goal. Through coded specifications, Jasmine helps make your JavaScript work exactly how its supposed to. In this book, well explore Jasmine in detail, from its basic concepts to its advanced features.

This book aims to explain the concepts of testing and test-driven development, as well as why theyre useful. It then aims to dive into Jasmine and explain how it can help programmers test their JavaScript code. By the end of this book, I aim to give readers an understanding of Jasmines concepts and syntax.

Who Should Read This Book

This book is intended for programmers who are familiar with some more advanced JavaScript features, such as closures and callbacks, and who have a general understanding of JavaScripts prototype system. If you are interested in learning how to write reliable JavaScript code, this is the book for you.

Jasmine is useful when building a maintainable and scalable JavaScript application, either in a browser or on a server. It can help ensure that a browsers client-side data models are performing properly, or that a server is correctly serving pages.

Jasmine is also useful for building reliable JavaScript libraries. It can help ensure that the exposed API of your library matches what you intend it to match.

Conventions Used in This Book

The following typographical conventions are used in this book:

Italic Indicates new terms, URLs, email addresses, filenames, and file extensions. Constant width Used for program listings, as well as within paragraphs to refer to program elements such as variable or function names, databases, data types, environment variables, statements, and keywords.
Tip

This icon signifies a tip, suggestion, or general note.

Using Code Examples

This book is here to help you get your job done. In general, if this book includes code examples, you may use the code in this book in your programs and documentation. You do not need to contact us for permission unless youre reproducing a significant portion of the code. For example, writing a program that uses several chunks of code from this book does not require permission. Selling or distributing a CD-ROM of examples from OReilly books does require permission. Answering a question by citing this book and quoting example code does not require permission. Incorporating a significant amount of example code from this book into your products documentation does require permission.

We appreciate, but do not require, attribution. An attribution usually includes the title, author, publisher, and ISBN. For example: JavaScript Testing with Jasmine by Evan Hahn (OReilly). Copyright 2013 Evan Hahn, 978-1-4493-5637-8.

If you feel your use of code examples falls outside fair use or the permission given above, feel free to contact us at .

Safari Books Online
Note

Safari Books Online is an on-demand digital library that delivers expert content in both book and video form from the worlds leading authors in technology and business.

Technology professionals, software developers, web designers, and business and creative professionals use Safari Books Online as their primary resource for research, problem solving, learning, and certification training.

Safari Books Online offers a range of product mixes and pricing programs for organizations, government agencies, and individuals. Subscribers have access to thousands of books, training videos, and prepublication manuscripts in one fully searchable database from publishers like OReilly Media, Prentice Hall Professional, Addison-Wesley Professional, Microsoft Press, Sams, Que, Peachpit Press, Focal Press, Cisco Press, John Wiley & Sons, Syngress, Morgan Kaufmann, IBM Redbooks, Packt, Adobe Press, FT Press, Apress, Manning, New Riders, McGraw-Hill, Jones & Bartlett, Course Technology, and dozens more. For more information about Safari Books Online, please visit us online.

How to Contact Us

Please address comments and questions concerning this book to the publisher:

OReilly Media, Inc.
1005 Gravenstein Highway North
Sebastopol, CA 95472
800-998-9938 (in the United States or Canada)
707-829-0515 (international or local)
707-829-0104 (fax)

We have a web page for this book, where we list errata, examples, and any additional information. You can access this page at http://oreil.ly/JS_Jasmine.

To comment or ask technical questions about this book, send email to .

For more information about our books, courses, conferences, and news, see our website at http://www.oreilly.com.

Find us on Facebook: http://facebook.com/oreilly

Follow us on Twitter: http://twitter.com/oreillymedia

Watch us on YouTube: http://www.youtube.com/oreillymedia

Acknowledgments

Thanks to RockMelt for asking me to learn Jasmine.

Thanks to Pivotal Labs for creating Jasmine.

Thanks to my parents for their constant support.

Chapter 1. Intro to Testing
What Is Software Testing?

In short, you can test software against a specification.

Lets say youre writing a simple calculator that just does addition. Before you even start, think about how it should behave. It should be able to add positive integers. It should be able to add negative integers. It should be able to add decimal numbers, not just integers. You can think of many different ways that your calculator needs to work.

Before youve written any of the code, you know how you want it to behave. You have a specification for its behavior.

You can write these specifications in code. Youd say, OK, it should work this way. Youd make tests that added 1 and 1, 2 and 2, 1 and 5, 1.2 and 6.8, 0 and 0, and so on. When you run these tests, youll either get a success (it works according to the specification) or a failure (it doesnt). If you ran all of your tests and saw success for each, then you can be pretty sure that your calculator works. If you ran these tests and saw some failures, then you know that your calculator doesnt work.

Thats software testing in a nutshell. Youre testing your code against a specification. There are many tools (Jasmine among them) that help you automate these software tests.

Its important to know that its difficult (and often impossible) to write tests for every case. In the calculator example, there are an infinite number of possible combinations. When testing, you should try to cover every reasonable case by testing a number of different groups (integers, negative numbers, mixes of the two, etc.). You should also identify boundary conditions (zeroes, for example) and edge cases, testing as many different scenarios as possible.

Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «JavaScript Testing with Jasmine: JavaScript Behavior-Driven Development»

Look at similar books to JavaScript Testing with Jasmine: JavaScript Behavior-Driven Development. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.


Reviews about «JavaScript Testing with Jasmine: JavaScript Behavior-Driven Development»

Discussion, reviews of the book JavaScript Testing with Jasmine: JavaScript Behavior-Driven Development and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.