Jasmine JavaScript Testing - Second Edition
eBook - ePub

Jasmine JavaScript Testing - Second Edition

Paulo Ragonha

Compartir libro
  1. 134 páginas
  2. English
  3. ePUB (apto para móviles)
  4. Disponible en iOS y Android
eBook - ePub

Jasmine JavaScript Testing - Second Edition

Paulo Ragonha

Detalles del libro
Vista previa del libro
Índice
Citas

Información del libro

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.

Preguntas frecuentes

¿Cómo cancelo mi suscripción?
Simplemente, dirígete a la sección ajustes de la cuenta y haz clic en «Cancelar suscripción». Así de sencillo. Después de cancelar tu suscripción, esta permanecerá activa el tiempo restante que hayas pagado. Obtén más información aquí.
¿Cómo descargo los libros?
Por el momento, todos nuestros libros ePub adaptables a dispositivos móviles se pueden descargar a través de la aplicación. La mayor parte de nuestros PDF también se puede descargar y ya estamos trabajando para que el resto también sea descargable. Obtén más información aquí.
¿En qué se diferencian los planes de precios?
Ambos planes te permiten acceder por completo a la biblioteca y a todas las funciones de Perlego. Las únicas diferencias son el precio y el período de suscripción: con el plan anual ahorrarás en torno a un 30 % en comparación con 12 meses de un plan mensual.
¿Qué es Perlego?
Somos un servicio de suscripción de libros de texto en línea que te permite acceder a toda una biblioteca en línea por menos de lo que cuesta un libro al mes. Con más de un millón de libros sobre más de 1000 categorías, ¡tenemos todo lo que necesitas! Obtén más información aquí.
¿Perlego ofrece la función de texto a voz?
Busca el símbolo de lectura en voz alta en tu próximo libro para ver si puedes escucharlo. La herramienta de lectura en voz alta lee el texto en voz alta por ti, resaltando el texto a medida que se lee. Puedes pausarla, acelerarla y ralentizarla. Obtén más información aquí.
¿Es Jasmine JavaScript Testing - Second Edition un PDF/ePUB en línea?
Sí, puedes acceder a Jasmine JavaScript Testing - Second Edition de Paulo Ragonha en formato PDF o ePUB, así como a otros libros populares de Informatik y Webentwicklung. Tenemos más de un millón de libros disponibles en nuestro catálogo para que explores.

Información

Año
2015
ISBN
9781785283208
Categoría
Informatik
Categoría
Webentwicklung

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...

Índice