Jasmine JavaScript Testing - Second Edition
eBook - ePub

Jasmine JavaScript Testing - Second Edition

Paulo Ragonha

Buch teilen
  1. 134 Seiten
  2. English
  3. ePUB (handyfreundlich)
  4. Über iOS und Android verfügbar
eBook - ePub

Jasmine JavaScript Testing - Second Edition

Paulo Ragonha

Angaben zum Buch
Buchvorschau
Inhaltsverzeichnis
Quellenangaben

Über dieses Buch

About This Book

  • Understand the term "performance" and its significance in designing applications
  • Dive deep into the internals of CLR, from memory management to the thread lifecycle
  • A step-by-step guide with a special focus on designing performance-oriented solutions to handle large datasets

Who This Book Is For

If you are a.NET developer with an understanding of application development, but want to learn how to optimize the performance of your applications, this is the book for you. Basic knowledge of C# is expected.

Häufig gestellte Fragen

Wie kann ich mein Abo kündigen?
Gehe einfach zum Kontobereich in den Einstellungen und klicke auf „Abo kündigen“ – ganz einfach. Nachdem du gekündigt hast, bleibt deine Mitgliedschaft für den verbleibenden Abozeitraum, den du bereits bezahlt hast, aktiv. Mehr Informationen hier.
(Wie) Kann ich Bücher herunterladen?
Derzeit stehen all unsere auf Mobilgeräte reagierenden ePub-Bücher zum Download über die App zur Verfügung. Die meisten unserer PDFs stehen ebenfalls zum Download bereit; wir arbeiten daran, auch die übrigen PDFs zum Download anzubieten, bei denen dies aktuell noch nicht möglich ist. Weitere Informationen hier.
Welcher Unterschied besteht bei den Preisen zwischen den Aboplänen?
Mit beiden Aboplänen erhältst du vollen Zugang zur Bibliothek und allen Funktionen von Perlego. Die einzigen Unterschiede bestehen im Preis und dem Abozeitraum: Mit dem Jahresabo sparst du auf 12 Monate gerechnet im Vergleich zum Monatsabo rund 30 %.
Was ist Perlego?
Wir sind ein Online-Abodienst für Lehrbücher, bei dem du für weniger als den Preis eines einzelnen Buches pro Monat Zugang zu einer ganzen Online-Bibliothek erhältst. Mit über 1 Million Büchern zu über 1.000 verschiedenen Themen haben wir bestimmt alles, was du brauchst! Weitere Informationen hier.
Unterstützt Perlego Text-zu-Sprache?
Achte auf das Symbol zum Vorlesen in deinem nächsten Buch, um zu sehen, ob du es dir auch anhören kannst. Bei diesem Tool wird dir Text laut vorgelesen, wobei der Text beim Vorlesen auch grafisch hervorgehoben wird. Du kannst das Vorlesen jederzeit anhalten, beschleunigen und verlangsamen. Weitere Informationen hier.
Ist Jasmine JavaScript Testing - Second Edition als Online-PDF/ePub verfügbar?
Ja, du hast Zugang zu Jasmine JavaScript Testing - Second Edition von Paulo Ragonha im PDF- und/oder ePub-Format sowie zu anderen beliebten Büchern aus Informatik & Webentwicklung. Aus unserem Katalog stehen dir über 1 Million Bücher zur Verfügung.

Information

Jahr
2015
ISBN
9781785283208

Jasmine JavaScript Testing Second Edition


Table of Contents

Jasmine JavaScript Testing Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Getting Started with Jasmine
JavaScript – the bad parts
Jasmine and behavior-driven development
Downloading Jasmine
Summary
2. Your First Spec
The Investment Tracker application
Jasmine basics and thinking in BDD
Setup and teardown
Nested describes
Setup and teardown
Coding a spec with shared behavior
Understanding matchers
Custom matchers
Built-in matchers
The toEqual built-in matcher
The toBe built-in matcher
The toBeTruthy and toBeFalsy matchers
The toBeUndefined, toBeNull, and toBeNaN built-in matchers
The toBeDefined built-in matcher
The toContain built-in matcher
The toMatch built-in matcher
The toBeLessThan and toBeGreaterThan built-in matchers
The toBeCloseTo built-in matcher
The toThrow built-in matcher
Summary
3. Testing Frontend Code
Thinking in terms of components (Views)
The module pattern
Using HTML fixtures
Basic View coding rules
The View should encapsulate a DOM element
Integrating Views with observers
Testing Views with jQuery matchers
The toBeMatchedBy jQuery matcher
The toContainHtml jQuery matcher
The toContainElement jQuery matcher
The toHaveValue jQuery matcher
The toHaveAttr jQuery matcher
The toBeFocused jQuery matcher
The toBeDisabled jQuery matcher
More matchers
Summary
4. Asynchronous Testing – AJAX
Acceptance criterion
Setting up the scenario
Installing Node.js
Coding the server
Running the server
Writing the spec
Asynchronous setups and teardowns
Asynchronous specs
Timeout
Summary
5. Jasmine Spies
The "bare" spy
Spying on an object's functions
Testing DOM events
Summary
6. Light Speed Unit Testing
Jasmine stubs
Jasmine Ajax
Installing the plugin
A fake XMLHttpRequest
Summary
7. Testing React Applications
Project setup
Our first React component
The Virtual DOM
JSX
Using JSX with Jasmine
Component attributes (props)
Component events
Component state
Component life cycle
Composing components
Summary
8. Build Automation
Module bundler – webpack
Module definition
Webpack project setup
Managing dependencies with NPM
Webpack configuration
The spec runner
Testing a module
Test runner: Karma
Quick feedback loop
Watch and run the tests
Watch and update the browser
Optimizing for production
Static code analysis: JSHint
Continuous integration – Travis-CI
Adding a project to Travis-CI
Project setup
Summary
Index

Jasmine JavaScript Testing Second Edition

Copyright © 2015 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: August 2013
Second edition: April 2015
Production reference: 1210415
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78528-204-1
www.packtpub.com

Credits

Author
Paulo Ragonha
Reviewers
Hany A. Elemary
Ryzhikov Maksim
Veer Shubhranshu Shrivastav
Sergey Simonchik
Commissioning Editor
Amarabha Banerjee
Acquisition Editor
Larissa Pinto
Content Development Editor
Manasi Pandire
Technical Editor
Anushree Arun Tendulkar
Copy Editor
Sarang Chari
Project Coordinator
Suzanne Coutinho
Proofreaders
Paul Hindle
Linda Morris
Indexer
Tejal Soni
Production Coordinator
Aparna Bhagat
Cover Work
Aparna Bhagat

About the Author

Paulo Ragonha is a software engineer with over 7 years of professional experience. An advocate of the open Web, he is inspired and driven to build compelling experiences on top of this ubiquitous platform.
He loves to hack, so you will often see him wandering around in conferences or attending hackathons. His most recent professional experiences ranged from DevOps (with Chef and Docker) to moving up the stack with Node.js, Ruby, and Python and all the way toward building single-page applications (mostly with Backbone.js and "ad hoc" solutions).
Passionate about automation, he sees testing as a liberating tool to enjoy the craft of writing code even more. Back in 2013, he wrote the first edition of the book Jasmine JavaScript Testing, Packt Publishing.
Paulo has an amazing wife, who he loves very much. He lives in beautiful Florianópolis, a coastal city in the south of Brazil. He is a casual speaker, a biker, a runner, and a hobbyist photographer.

About the Reviewers

Hany A. Elemary is a software engineer / technical team lead at OCLC in Columbus, Ohio, currently working on the next generation of mobile/web apps (http://www.worldcat.org and WorldCat for local institutions). He has been blessed with diverse experience while working for multiple companies (from small software shops t...

Inhaltsverzeichnis