100% found this document useful (2 votes)
123 views

Download ebooks file Testing JavaScript Applications 1st Edition Lucas Da Costa all chapters

The document promotes the ebook 'Testing JavaScript Applications' by Lucas Da Costa, available for download on ebookmeta.com, along with several other recommended digital products. It includes links to various titles related to JavaScript testing, coaching, and other academic subjects. Additionally, it provides information about the publisher, Manning Publications Co., and their policies regarding copyright and environmental responsibility.

Uploaded by

borkafirer7y
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
123 views

Download ebooks file Testing JavaScript Applications 1st Edition Lucas Da Costa all chapters

The document promotes the ebook 'Testing JavaScript Applications' by Lucas Da Costa, available for download on ebookmeta.com, along with several other recommended digital products. It includes links to various titles related to JavaScript testing, coaching, and other academic subjects. Additionally, it provides information about the publisher, Manning Publications Co., and their policies regarding copyright and environmental responsibility.

Uploaded by

borkafirer7y
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 40

Get the full ebook with Bonus Features for a Better Reading Experience on ebookmeta.

com

Testing JavaScript Applications 1st Edition Lucas


Da Costa

https://ebookmeta.com/product/testing-javascript-
applications-1st-edition-lucas-da-costa/

OR CLICK HERE

DOWLOAD NOW

Download more ebook instantly today at https://ebookmeta.com


Recommended digital products (PDF, EPUB, MOBI) that
you can download immediately if you are interested.

Jasmine JavaScript Testing 2nd Edition Test your


JavaScript applications efficiently using Jasmine and
React js Paulo Ragonha
https://ebookmeta.com/product/jasmine-javascript-testing-2nd-edition-
test-your-javascript-applications-efficiently-using-jasmine-and-react-
js-paulo-ragonha/
ebookmeta.com

6th International Conference on Adhesive Bonding 2021


Selected Contributions of AB 2021 1st Edition Lucas F. M.
Da Silva
https://ebookmeta.com/product/6th-international-conference-on-
adhesive-bonding-2021-selected-contributions-of-ab-2021-1st-edition-
lucas-f-m-da-silva/
ebookmeta.com

The European Monetary Union After the Crisis From a Fiscal


Union to Fiscal Capacity 1st Edition Nazare Da Costa
Cabral
https://ebookmeta.com/product/the-european-monetary-union-after-the-
crisis-from-a-fiscal-union-to-fiscal-capacity-1st-edition-nazare-da-
costa-cabral/
ebookmeta.com

The Broken Afternoon 1st Edition Simon Mason

https://ebookmeta.com/product/the-broken-afternoon-1st-edition-simon-
mason/

ebookmeta.com
The Chicago Guide to Copyediting Fiction 1st Edition Amy
J. Schneider

https://ebookmeta.com/product/the-chicago-guide-to-copyediting-
fiction-1st-edition-amy-j-schneider/

ebookmeta.com

Sticky Treats 1st Edition Monica Myers

https://ebookmeta.com/product/sticky-treats-1st-edition-monica-myers/

ebookmeta.com

Problematizing Law, Rights, and Childhood in


Israel/Palestine Hedi Viterbo

https://ebookmeta.com/product/problematizing-law-rights-and-childhood-
in-israel-palestine-hedi-viterbo/

ebookmeta.com

Disney Junior Mickey Christmas Tales Disney Books

https://ebookmeta.com/product/disney-junior-mickey-christmas-tales-
disney-books/

ebookmeta.com

Cognitive Behavioural Coaching in Practice An Evidence


Based Approach 2nd Edition Michael Neenan

https://ebookmeta.com/product/cognitive-behavioural-coaching-in-
practice-an-evidence-based-approach-2nd-edition-michael-neenan/

ebookmeta.com
Now What Confronting Uncomfortable Truths About Inequity
in Schools A Leadership Rubric for Action 1st Edition
Carmella S. Franco
https://ebookmeta.com/product/now-what-confronting-uncomfortable-
truths-about-inequity-in-schools-a-leadership-rubric-for-action-1st-
edition-carmella-s-franco/
ebookmeta.com
inside front cover
Testing JavaScript Applications

LUCAS DA COSTA

To comment go to liveBook

Manning
Shelter Island

For more information on this and other Manning titles go to


www.manning.com
Copyright

For online information and ordering of these and other


Manning books, please visit www.manning.com. The
publisher offers discounts on these books when ordered in
quantity.

For more information, please contact

Special Sales Department


Manning Publications Co.
20 Baldwin Road
PO Box 761
Shelter Island, NY 11964
Email: orders@manning.com

©2021 by Manning Publications Co. All rights


reserved.

No part of this publication may be reproduced, stored in a


retrieval system, or transmitted, in any form or by means
electronic, mechanical, photocopying, or otherwise, without
prior written permission of the publisher.

Many of the designations used by manufacturers and sellers


to distinguish their products are claimed as trademarks.
Where those designations appear in the book, and Manning
Publications was aware of a trademark claim, the
designations have been printed in initial caps or all caps.

♾ Recognizing the importance of preserving what has been


written, it is Manning’s policy to have the books we publish
printed on acid-free paper, and we exert our best efforts to
that end. Recognizing also our responsibility to conserve the
resources of our planet, Manning books are printed on
paper that is at least 15 percent recycled and processed
without the use of elemental chlorine.

Manning Publications Co.


20 Baldwin Road Technical
PO Box 761
Shelter Island, NY 11964

Development editor: Helen Stergius


Technical development editor: Dennis Sellinger
Review editor: Mihaela Batinić
Production editor: Lori Weidert
Copy editor: Pamela Hunt
Proofreader: Keri Hales
Technical proofreader: Srihari Sridharan
Typesetter and cover designer: Marija Tudor

ISBN: 9781617297915
dedication
In memory of my grandmother, Marli Teixeira da Costa, who
always did everything she could for me to succeed.
contents
preface
acknowledgments
about this book
about the author
about the cover illustration

Part 1. Testing JavaScript applications


1 An introduction to automated testing
1.1 What is an automated test?
1.2 Why automated tests matter
Predictability
Reproducibility
Collaboration
Speed

2 What to test and when?


2.1 The testing pyramid
2.2 Unit tests
2.3 Integration tests
2.4 End-to-end tests
Testing HTTP APIs
Testing GUIs
Acceptance tests and end-to-end tests are not the same
2.5 Exploratory testing and the value of QA
2.6 Tests, cost, and revenue

Part 2. Writing tests


3 Testing techniques
3.1 Organizing test suites
Breaking down tests
Parallelism
Global hooks
Atomicity
3.2 Writing good assertions
Assertions and error handling
Loose assertions
Using custom matchers
Circular assertions

3.3 Test doubles: Mocks, stubs, and spies


Mocking imports

3.4 Choosing what to test


Don’t test third-party software
To mock, or not to mock: That’s the question
When in doubt, choose integration tests

3.5 Code coverage


Automated coverage reports
Coverage types
What coverage is good for and what it isn’t

4 Testing backend applications


4.1 Structuring a testing environment
End-to-end testing
Integration testing
Unit testing
4.2 Testing HTTP endpoints
Testing middleware
4.3 Dealing with external dependencies
Integrations with databases
Integrations with other APIs

5 Advanced backend testing techniques


5.1 Eliminating nondeterminism
Parallelism and shared resources
Dealing with time

5.2 Reducing costs while preserving quality


Reducing overlap between tests
Creating transitive guarantees
Turning assertions into preconditions

6 Testing frontend applications


6.1 Introducing JSDOM
6.2 Asserting on the DOM
Making it easier to find elements
Writing better assertions

6.3 Handling events


6.4 Testing and browser APIs
Testing a localStorage integration
Testing a History API integration
6.5 Dealing with WebSockets and HTTP requests
Tests involving HTTP requests
Tests involving WebSockets

7 The React testing ecosystem


7.1 Setting up a test environment for React
Setting up a React application
Setting up a testing environment

7.2 An overview of React testing libraries


Rendering components and the DOM
React Testing Library
Enzyme
The React test renderer

8 Testing React applications


8.1 Testing component integration
Stubbing components
8.2 Snapshot testing
Snapshots beyond components
Serializers
8.3 Testing styles
8.4 Component-level acceptance tests and component
stories
Writing stories
Writing documentation

9 Test-driven development
9.1 The philosophy behind test-driven development
What test-driven development is
Adjusting the size of your iterations
Why adopt test-driven development?
When not to apply test-driven development
9.2 Writing a JavaScript module using TDD
9.3 Testing top-down versus testing bottom-up
What bottom-up and top-down testing mean
How top-down and bottom-up approaches impact a test-driven
workflow
The pros and cons of bottom-up versus top-down approaches

9.4 Balancing maintenance costs, delivery speed, and


brittleness
Test-driven implementation
Test-driven maintenance
9.5 Setting up an environment for TDD to succeed
Teamwide adoption
Keeping distinct lanes
Pairing
Supplementary testing
9.6 TDD, BDD, validations, and specificationsBDD (behavior-
driven development)
10 UI-based end-to-end testing
10.1 What are UI-based end-to-end tests?
10.2 When to write each type of test
UI-based end-to-end tests
Pure end-to-end tests
Pure UI tests
A note on acceptance testing and this chapter’s name
10.3 An overview of end-to-end testing tools
Selenium
Puppeteer
Cypress
When to choose Cypress

11 Writing UI-based end-to-end tests


11.1 Your first UI-based end-to-end tests
Setting up a test environment
Writing your first tests
Sending HTTP requests
Sequencing actions
11.2 Best practices for end-to-end-tests
Page objects
Application actions
11.3 Dealing with flakiness
Avoiding waiting for fixed amounts of time
Stubbing uncontrollable factors
Retrying tests

11.4 Running tests on multiple browsers


Using a testing framework to run tests within a browser
Running UI-based tests in multiple browsers
11.5 Visual regression tests

Part 3. Business impact


12 Continuous integration and continuous delivery
12.1 What are continuous integration and continuous
delivery?
Continuous integration
Continuous delivery
12.2 The role of automated tests in a CI/CD pipeline
12.3 Version-control checks
13 A culture of quality
Another Random Scribd Document
with Unrelated Content
Trouvères

(12th Century)

Blondel de Nesle
Chrétien de Troyes
Chatelain de Coucy
Gace Brulé

(13th Century)

Colin Muset
Minnesingers

(12th Century)

Kürenberger
von Aist
Spervogel

(13th Century)

Wolfram von Eschenbach


Walther von der Vogelweide
Prince Witzlav
Tannhäuser
Nitthart
Biterolf
Meistersingers

Heinrich von Meissen (“Frauenlob”)


Til Eulenspiegel
Hans Sachs (1494–1576)
Motets and Madrigals

Franco-Belgian Period

Guillaume Dufay (1400–1474)


Jakob Hobrecht (1430–1506)
Jan de Okeghem (1430–1495)
Josquin Deprès (1450–1521)
Heinrich Isaak (1450–15 ?)
Jean Mouton (14 ?–1522)
Heinric Finck (14 ?–15 ?) (German)
Jakob Clemens non Papa (1475–1567)
Claude Goudimel (1505–1572)

Flemish Period

Jakob Arcadelt (1514–1565)


Adrian Willaert (1480–1562)
Nicolas Gombert (14 ?–15 ?)
Cyprian de Rore (1516–1565)
Philippe de Monte (1521–1602)
Orlandus Lassus (1530–1594)

Italian Period

Constanza Festa (14 ?–1545)


Giovanni Animuccia (15 ?–1571)
Andrea Gabrieli (1510–1586)
Giovanni Pierluigi da Palestrina (1515–1594)
Orazio Vecchi (1550?–1605)
Matteo Asola (15 ?–1609)
Luca Marenzio (1550?–1599)
Giovanni Gabrieli (1557–1613)
Felice Anerio (1560–1630)
Andriano Banchieri (1567–1634)
French Period

Claudin de Sermizy (15 ?–1566)


Claudin le Jeune (1530–1564)
Guillaume Costeley (1531–15 ?)

German Period

Hans Leo Hassler (1564–1612)

English Period

John Taverner ( ? –1530)


William Byrd (1538–1623)
Thomas Morley (1557–1604)
Thomas Weelkes ( ? –1623)
George Kirbye ( ? – ?)
John Dowland (1562–1628)
John Wilbye (1574–1638)
Michael Este ( ? – ?)
Orlando Gibbons (1583–1625)
Fugues

Italian

Andrea Gabrieli (1510–1586)


Giovanni Gabrieli (1557–1613)
Adriano Banchieri (1567–1637)
Girolamo Frescobaldi (1583–1644)

English

Thomas Tallis (15 ?–1585)


William Byrd (1538–1623)

Dutch

Jan Pieters Sweelinck (1562–1621)

Danish

Dietrich Buxtehude (1637–1707)

German

Samuel Scheidt (1587–1654)


Johann Jacob Froberger (1605–1667)
Georg Muffat (16 ?–1704)
Johann Pachelbel (1653–1706)
Johann Krieger (1652–1735)
Johann Joseph Fux (1650–1741)
Johann Sebastian Bach (1685–1750)
George Frederic Handel (1685–1759)
Friedrich Marpurg (1718–1795)
Johann Georg Albrechtsberger (1736–1809)
French

François Couperin (1631–1698)


Jean Louis Marchand (1669–1732)
Louis Nicolas Clérembault (1676–1749)
Modern Fugues

German

August Klengel (1783–1852)


Wolfgang Amadeus Mozart (1756–1791)
Felix Mendelssohn-Bartholdy (1809–1847)
Robert Schumann (1810–1856)
Johannes Brahms (1833–1897)
Salomon Jadassohn (1831–1902)
Max Reger (1873–1916)

French

César Franck (Belg.) (1822–1890)


André Gédalge (1857–1926)
Camille Saint-Saëns (1835–1921)

American

Daniel Gregory Mason (1873)


Mrs. H. H. A. Beach (1867)
Charles Haubiel (1892)

Swedish

Emil Sjögren (1853–1918)

Czecho-Slovakian

Felix Petyrek (20th Century)


Suites

(Sonata da Camera, Sonata da Chiesa, Sonatas, Ordres, Suites,


Exercises, Partitas)

Italian

Girolamo Frescobaldi (1583–1644)


Michel Angelo Rossi (159 ?–16 ?)
Giovanni Legrenzi (1625–1690)
Bernardo Pasquini (1637–1710)
Giovanni Bononcini (1640–1678)
Giovanni Battista Vitali (1644–1692)
Giuseppe Torelli (1645–1708)
Domenico Zipoli (16 ?–17 ?)
Evarista Felice d’all’Abaco (16 ?–17 ?)
Domenico Scarlatti (1685–1760)

French

Jacques Champion de Chambonnières (1610–1671)


François Couperin (1668–1733)
Jean Philippe Rameau (1683–1764)
Jean François Dandrieu (1684–1740)
Jean Marie Leclair (1687–1764)

German

Johann Schein (1586–1630)


Samuel Scheidt (1587–1754)
Johann Kuhnau (1660–1722)
Johann Sebastian Bach (1685–1750)
George Frederic Handel (1685–1759)
Modern Suites

German

Joseph Joachim Raff (Swiss) (1822–1882)


Karl Reinecke (1824–1910)
Ignaz Brüll (1846–1907)
Ferdinand Hummel (1855)

French

Charles Marie Widor (1845)


Benjamin Godard (1849–1895)
Claude Debussy (1862–1918)

Russian

Serge Rachmaninov (1873)

Hungarian

Emanuel Moor (1862)

English

Eugen D’Albert (1864)


York Bowen (1884)

Scandinavian

Edvard Grieg (Norwegian) (1843–1907)


Christian Sinding (Norwegian) (1856)
Johan Halvorsen (Norwegian) (1864)
American

Edward MacDowell (1861–1908)


Arthur Whiting (1861)
Sonatas

(Before Beethoven)

German

Johann Kuhnau (1660–1722)


Johann Mattheson (1681–1764)
Georg Philip Telemann (1681–1767)
Johann Sebastian Bach (1685–1750)
George Frederic Handel (1685–1759)
Karl Philip Emanuel Bach (1714–1788)
Leopold Mozart (1719–1788)
Joseph Haydn (1732–1809)
Wolfgang Amadeus Mozart (1756–1791)
Ludwig van Beethoven (1770–1826)

Italian

Arcangelo Corelli (1653–1713)


Francesco Maria Veracini (1685–1750)
Domenico Scarlatti (1685–1750)
Giuseppe Tartini (1692–1770)
Pietro Locatelli (1693–1764)
Baldassare Galuppi (1706–1784)
Pietro Nardini (1722–1793)
Gaetano Pugnani (1731–1798)
Pietro Domenico Paradies (1710–1792)

(Contemporaries of Beethoven)

German

Johann Dussek (Bohemian) (1761–1812)


Johann Cramer (1771–1858)
Johann Woelfl (1772–1812)
Johann Hummel (1778–1837)
Ferdinand Ries (1784–1838)
Karl Maria von Weber (1786–1824)
Friedrich W. M. Kalkbrenner (1788–1849)
Ignaz Moscheles (Bohemian) (1794–1870)
Franz Schubert (1797–1828)

Italian

Muzio Clementi (1752–1832)


Luigi Cherubini (1760–1842)

English

John Field (1782–1837)

After Beethoven

German and Austrian

Heinrich Marschner (1795–1861)


Felix Mendelssohn-Bartholdy (1809–1847)
Robert Schumann (1810–1856)
Joseph Raff (Swiss) (1822–1882)
Karl Reinecke (1824–1910)
Johannes Brahms (1833–1897)
Ludwig Thuille (1861–1907)
Richard Strauss (1864)
Georg Schumann (1866)
Alexander Zemlinsky (1872)
Max Reger (1873–1916)
Heinz Tiessen (1887)
Hermann Scherchen (1891)
Egon Kornauth (Austrian) (1891)
Philipp Jarnach (1892)
Paul Pisk (1893)
Paul Hindemith (1895)
Erich Wolfgang Korngold (Austrian) (1897)
Ernst Krenek (Austrian) (1900)

Czecho-Slovakian

Rudolph Karel (1881)


Emil Axman (20th Century)

Hungarian

Franz Liszt (1811–1886)


Emanuel Moor (1862)
Ernst von Dohnanyi (1877)
Bela Bartok (1881)
Zoltan Kodaly (1882)

French

César Franck (Belgian) (1822–1890)


Camille Saint-Saëns (1835–1919)
Felix Alexandre Guilmant (1837–1911)
Gabriel Fauré (1845–1924)
Charles Marie Widor (1845)
Benjamin Godard (1849–1895)
Paul Vincent d’Indy (1851)
Claude Achille Debussy (1862–1918)
Guy Ropartz (1864)
Paul Dukas (1865)
Charles Koechlin (1867)
Guillaume Lekeu (Belgian) (1870–1894)
Florent Schmitt (1870)
Maurice Ravel (1875)
Rhené-Baton (1879)
Gabriel Grovlez (1879)
Arthur Honegger (1892)
Darius Milhaud (1892)
Germaine Taillefer (1892)
Raymond Petit (20th Century)

Dutch

Dirk Schaefer (1874)


James Zwart (1892)
Willem Pijper (1894)

Russian

Anton Rubinstein (1829–1894)


Georg Lvovitch Catoire (1861)
Joseph Wihtol (1863)
Alexander Scriabin (1872–1915)
Paul Juon (1872)
Serge Rachmaninov (1873)
Alexander Glazounov (1873)
Fedor Akimenko (1876)
Nicholas Medtner (1879)
Nicholai Miaskovsky (1881)
Samuel Feinberg (1890)
Alexander Tcherepnin (1902)

Polish

Frédéric Chopin (1809–1849)


Ignace Jan Paderewski (1860)
Miecyslaw Karlowicz (1876–1909)
Karol Szymanowsky (1883)

Scandinavian

Johan P. E. Hartmann (Danish) (1805–1900)


Edvard Hagerup Grieg (Norwegian) (1843–1907)
Emil Sjögren (Swedish) (1853–1918)
Bror Beckman (Swedish) (1866)
Wilhelm Stenhammar (Swedish) (1871)

Italian

Enrico Bossi (1861–1925)


Ferruccio Busoni (1866–1924)
Ildebrando Pizzetti (1880)

Spanish

Isaac Albeniz (1860–1909)

English

C. Hubert H. Parry (1848–1918)


Marie Wurm (1860) (Living in Germany)
John B. McEwen (1868)
Wm. Y. Hurlstone (1876–1906)
Cyril Scott (1879)
Arnold Bax (1882)
York Bowen (1884)
James Friskin (1886)

American

John Knowles Paine (1839–1906)


Arthur Foote (1853)
Edward MacDowell (1861–1908)
Ernest Kroeger (1862)
Henry Holden Huss (1862)
Mrs. H. H. A. Beach (1867)
Frederick Converse (1871)
John Alden Carpenter (1876)
Louis Campbell-Tipton (1877–1921)
Alexander MacFayden (1879)
Ernest Bloch (Swiss) (1880)
Arthur Shepherd (1880)
John Powell (1882)
Charles Griffes (1884–1920)
Emerson Whithorne (1884)
Louis Gruenberg (1884)
Marion Bauer (1887)
Chalmers Clifton (1889)
Harold Morris (1889)
Elliot Griffis (1892)
Albert Stoessel (1894)
Leo Ornstein (Russian) (1895)
George Antheil (20th Century)
Fanny Charles Dillon (20th Century)
Classic Concertos

German (Before Mozart)

Johann Sebastian Bach (1685–1750)


George Frederic Handel (1685–1759)
Johann Gottlieb Graun (1701–1759)
Franz Benda (Bohemian) (1709–1786)
Wilhelm Friedemann Bach (1710–1784)
Karl Phillip Emanuel Bach (1714–1788)
Franz Joseph Haydn (1732–1809)

French

Jean Marie Leclair (1697–1764)


Jean Philippe Rameau (1683–1764)

Italian

Antonio Vivaldi (1675–1743)


Francesco Maria Veracini (1685–1750)
Giuseppe Tartini (1692–1770)
Concertos

German and Austrian

Wolfgang Amadeus Mozart (1756–1791)


Ludwig van Beethoven (1770–1827)
Joseph Woelfl (1772–1812)
Johann Hummel (1778–1837)
Ferdinand Ries (1784–1838)
Karl Maria von Weber (1786–1826)
Ignaz Moscheles (Bohemian) (1794–1870)
Felix Mendelssohn-Bartholdy (1809–1847)
Robert Schumann (1810–1856)
Georg E. Goltermann (1824–1898)
Karl Reinecke (1824–1910)
Johannes Brahms (1833–1897)
Max Bruch (1838–1917)
Josef Rheinberger (1839–1901)
Heinrich Hofmann (1842–1902)
Ignaz Brüll (1846–1907)
Richard Strauss (1864)
Hans Pfitzner (1869)
Max Reger (1873–1916)
Alban Berg (1885)
Ernst Toch (1887)
Paul Hindemith (1895)
Ernst Krenek (1900)
Heinrich Kaminsky (20th Century)

Czecho-Slovakian

Antonin Dvorak (1841–1904)


Erwin Schulhoff (1894)
Vaclav Talich (20th Century)
Hungarian

Franz Liszt (1811–1888)


Joseph Joachim (1831–1907)
Jeno Hubay (1858)
Julius Major (1859)
Emanuel Moor (1862)
Ottokar Novacek (1866–1900)
Ernst von Dohnanyi (1877)
Béla Bártok (1881)

French

Jacques Rode (1774–1830)


Henri Vieuxtemps (1820–1881)
César Franck (Belg.) (1822–1890)
Edouard Lalo (1823–1892)
Camille Saint-Saëns (1835–1921)
Charles Marie Widor (1845)
Gabriel Fauré (1845–1924)
Benjamin Godard (1849–1895)
Ernest Chausson (1855–1899)
Gabriel Pierné (1863)
Darius Milhaud (1892)
Germaine Tailleferre (1892)
Jean Wiener (20th Century)

Belgian

Théophile Ysaye (1865–1918)


Joseph Jongen (1873)

Dutch

Julius Roentgen (1855)


Dirk Schaefer (1874)
James Zwart (1892)

You might also like