• Complain

Alex Jover Morales - Testing Vue.js Components with Jest: A concise guide to testing Vue.js components using Jest and the official Vue Test Utils library

Here you can read online Alex Jover Morales - Testing Vue.js Components with Jest: A concise guide to testing Vue.js components using Jest and the official Vue Test Utils library full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. year: 2019, publisher: Packt Publishing, genre: Home and family. 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.

No cover
  • Book:
    Testing Vue.js Components with Jest: A concise guide to testing Vue.js components using Jest and the official Vue Test Utils library
  • Author:
  • Publisher:
    Packt Publishing
  • Genre:
  • Year:
    2019
  • Rating:
    3 / 5
  • Favourites:
    Add to favourites
  • Your mark:
    • 60
    • 1
    • 2
    • 3
    • 4
    • 5

Testing Vue.js Components with Jest: A concise guide to testing Vue.js components using Jest and the official Vue Test Utils library: summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "Testing Vue.js Components with Jest: A concise guide to testing Vue.js components using Jest and the official Vue Test Utils library" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

Unit test your Vue.js components with this fully-featured JavaScript testing framework

Key Features

  • Understand the various testing styles and their purpose
    • Gain insight into how to test methods by avoiding dependencies
    • Explore snapshot testing and its applications

      Book Description

      Unit testing in modern component-based JavaScript frameworks is not straightforward. You need a test suite that is reliable and runs quickly. Components are connected to one another, and the browser adds a layer of UI, which makes everything inter-dependent while we test components in isolation. Jest is a fully-featured JavaScript testing framework that will do all your work for you.

      This book shows you how to test Vue.js components easily and take advantage of the fully-featured Jest testing framework with the aid of practical examples. Youll learn the different testing styles and their structures. Youll also explore how your Vue.js components respond to various tests. Youll see how to apply techniques such as snapshot testing, shallow rendering, module dependency mocking, and module aliasing to make your tests smooth and clean.

      By the end of this book, youll know all about testing your components by utilizing the features of Jest.

      What you will learn

    • Set up a Vue-test project to get started with Jest
    • Unit test your components using techniques such as shallow rendering
    • Gain insights into how to test the reactive parts in the logic of the Vue.js components
    • Explore how to test deeply rendered Vue.js components
    • Perform easy and quick tests with module dependency mocking, module aliasing, and more
    • Know-how and when to use snapshot testing

      Who this book is for

      If you are a programmer looking to make your development process smooth and bug-free, this is an ideal book for you. Prior knowledge and experience of JavaScript will help you quickly and easily grasp the concepts explained in this book.

  • Alex Jover Morales: author's other books


    Who wrote Testing Vue.js Components with Jest: A concise guide to testing Vue.js components using Jest and the official Vue Test Utils library? Find out the surname, the name of the author of the book and a list of all author's works by series.

    Testing Vue.js Components with Jest: A concise guide to testing Vue.js components using Jest and the official Vue Test Utils library — 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 "Testing Vue.js Components with Jest: A concise guide to testing Vue.js components using Jest and the official Vue Test Utils library" 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
    Testing Vuejs Components with Jest A concise guide to testing Vuejs - photo 1
    Testing Vue.js Components with Jest
    A concise guide to testing Vue.js components using Jest and the official Vue Test Utils library Alex Jover Morales
    Testing Vue.js Components with Jest
    Copyright 2019 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. Author: Alex Jover Morales Managing Editor: Ashish James Acquisitions Editor: Karan Wadekar Production Editor: Salma Patel Editorial Board: Bharat Botle, Ewan Buckingham, Megan Carlisle, Simon Cox, Mahesh Dhyani, Manasa Kumar, Alex Mazonowicz, Dominic Pereira, Shiny Poojary, Abhishek Rane, Erol Staveley, Ankita Thakur, Nitesh Thakur, and Jonathan Wray First Published: October 2019 Production Reference: 1171019 ISBN: 978-1-83921-968-9 Published by Packt Publishing Ltd. Livery Place, 35 Livery Street Birmingham B3 2PB, UK

    Table of Contents
    Chapter 1:
    Chapter 2:
    Chapter 3:
    Chapter 4:
    Chapter 5:
    Chapter 6:
    Chapter 7:
    Chapter 8:
    Chapter 9:
    Preface
    About
    This section briefly introduces the author and what this book covers.
    About the Book
    Unit testing in modern component-based JavaScript frameworks is not straightforward. You need a test suite that is reliable and runs quickly. Components are connected to one another, and the browser adds a layer of UI, which makes everything inter-dependent while we test components in isolation.

    Jest is a fully-featured JavaScript testing framework that will do all your work for you. This book shows you how to test Vue.js components easily and take advantage of the fully-featured Jest testing framework with the aid of practical examples. You'll learn the different testing styles and their structures. You'll also explore how your Vue.js components respond to various tests. You'll see how to apply techniques such as snapshot testing, shallow rendering, module dependency mocking, and module aliasing to make your tests smooth and clean.

    About the Authors
    Alex Jover Morales is a Vue.js core team partner.
    About the Authors
    Alex Jover Morales is a Vue.js core team partner.

    He co-organizes Alicante Frontend and Vue Day. He is an instructor at Alligatorio and is interested in web performance, PWA, code quality, and the human side of code.

    Learning Objectives
    • Set up a Vue-test project to get started with Jest
    • Unit test your components using techniques such as shallow rendering
    • Gain insights into how to test the reactive parts in the logic of the Vue.js components
    • Explore how to test deeply rendered Vue.js components
    • Perform easy and quick tests with module dependency mocking, module aliasing, and more
    • Know-how and when to use snapshot testing
    Audience
    If you are a programmer looking to make your development process smooth and bug-free, this is an ideal book for you. Some prior knowledge and experience of JavaScript will help you quickly and easily grasp the concepts explained in this book.
    Approach
    This book uses easy-to-understand language to explain the various concepts of testing.
    Chapter 1
    Write the First Vue.js Component Unit Test in Jest
    The official VueJS testing library, vue-test-utils (https://github.com/vuejs/vue-test-utils), which is based on avoriaz (https://github.com/eddyerburgh/avoriaz), is just around the corner.
    Chapter 1
    Write the First Vue.js Component Unit Test in Jest
    The official VueJS testing library, vue-test-utils (https://github.com/vuejs/vue-test-utils), which is based on avoriaz (https://github.com/eddyerburgh/avoriaz), is just around the corner.

    Indeed, @EddYerburgh (https://twitter.com/EddYerburgh) is doing a very good job of creating it. This library provides all the necessary tooling to make writing unit tests in a VueJS application easy. Jest (https://facebook.github.io/jest), on the other side, is a testing framework developed at Facebook, which makes testing a breeze using a number of awesome features, including the following:

    • Almost no configuration by default
    • A very cool interactive mode
    • Running tests in parallel
    • Testing with Spies, stubs, and mocks out of the box
    • Built-in code coverage
    • Snapshot testing
    • Module-mocking utilities
    You've probably already written tests without using any of these tools, just by using Karma, Mocha, Chai, Sinon, and so on, but you'll see how much easier it can be with these tools.
    Setting Up a vue-test Sample Project
    Let's start by creating a new project using vue-cli (https://github.com/vuejs/vue-cli) and answering NO to all yes/no questions: npm install -g vue-cli vue init webpack vue-test cd vue-test Then, we'll need to install some dependencies, as follows: # Install dependencies npm i -D jest vue-jest babel-jest jest-vue-preprocessor (https://github.com/vire/jest-vue-preprocessor) is required to make Jest understand .vue files, and babel-jest (https://github.com/facebook/jest/tree/master/packages/babel-jest) is required for integration with Babel. Now install 'vue-test-utils' library. npm i -D @vue/test-utils Let's add the following Jest configuration in the package.json: { "jest": { "moduleNameMapper": { "^vue$": "vue/dist/vue.common.js" }, "moduleFileExtensions": ["js", "vue"], "transform": { "^.+\\.js$": "/node_modules/babel-jest", ".*\\.(vue)$": "/node_modules/vue-jest" } } } moduleFileExtensions
    Next page
    Light

    Font size:

    Reset

    Interval:

    Bookmark:

    Make

    Similar books «Testing Vue.js Components with Jest: A concise guide to testing Vue.js components using Jest and the official Vue Test Utils library»

    Look at similar books to Testing Vue.js Components with Jest: A concise guide to testing Vue.js components using Jest and the official Vue Test Utils library. 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 «Testing Vue.js Components with Jest: A concise guide to testing Vue.js components using Jest and the official Vue Test Utils library»

    Discussion, reviews of the book Testing Vue.js Components with Jest: A concise guide to testing Vue.js components using Jest and the official Vue Test Utils library 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.