• Stars
    star
    168
  • Rank 225,507 (Top 5 %)
  • Language
    JavaScript
  • License
    Apache License 2.0
  • Created almost 5 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

๐Ÿ“– The repository which accompanies the book Testing JavaScript Applications.

Testing JavaScript Applications

A Manning book by Lucas da Costa


โžก Available at Manning.com

๐Ÿ“• About this book

Testing JavaScript Applications will help you write high-quality software in less time, with more confidence.

In the last five years, I have been deeply involved in the JavaScript testing scene. I am a core-maintainer of both Chai.js and Sinon.js, two of the most popular testing libraries in JavaScript, and I closely follow projects like Jest and Mocha. In this book, I expect to teach you what I've learned during those years in which I've been involved in vetting and implementing features, defining best-practices, and designing the libraries that thousands of people use every day.

Throughout this book's pages, you will learn how to write effective tests through various diagrams and practical examples we'll build together. Because I believe the best way to learn something is by doing it yourself, I've put in this repository all of the book's examples, so that you can experiment with them on your own and compare your solutions to the ones which I've implemented.

Besides covering specific tools, like Jest, and techniques, like TDD, it will teach you how to think about tests from a business perspective. You will learn what to take into account when designing tests, and how to make optimal decisions for your specific context.

I've written Testing JavaScript Applications thinking mostly about Junior Developers. They are the ones who will benefit the most from this book's approach to tests, which covers both the "hows" and the "whys" of writing automated tests.

Even though Junior Developers will be the ones who will benefit the most from this book, it also contains topics which cater to senior and mid-level developers. It includes my thoughts on how tests impact a business, how they structure relationships within teams, and other aspects involved in building what I'd call "a culture of quality".

To get the most out of "Testing JavaScript Applications", you must have a basic understanding of JavaScript. You should know how to use objects, functions, callbacks, and, especially, Promises. Basic knowledge of CSS and HTML is also required for the chapters in which we'll test a front-end application.

Because I've tried to make the examples in this book as close to reality as possible, there will be chapters in which we'll test a Node.js back-end application, and others in which we'll test a React application. Therefore, it will be necessary to have elementary knowledge about these tools. Reading their "getting started" guides should take you approximately 15 minutes each, and will be enough for you to follow along with the testing examples.

If you have any questions, comments, or suggestions, I'd love to hear them. With your invaluable feedback, we'll build a better book together.

I wish you all a productive, pleasant, and exciting journey.

โ€” Lucas da Costa


๐Ÿ“ About this repository

This repository contains all of the examples in the book Testing JavaScript Applications.

I have organised examples in a separate folder for each chapter and, within a chapter, I've separated them by section. Sometimes, even within sections, you will find sub-divisions with the multiple stages of an exercise or with different approaches to solving the same problem.


๐Ÿ’ป Running these examples

I've built these examples using Node.js v12 and NPM v6.

Before executing any of these examples, cd into the folder you want to try and run npm install to install its dependencies.

Most of the examples have an NPM script named test. Which means that you can execute tests for that example by using npm test.


๐Ÿค How to contribute

Together, we can build better content.

If you happen to find any problems in any of these examples, feel free to submit a Pull Request explaining what the problem was and how you solved it.

In case you have a better solution for any of the exercises, I'd love to see it. In that case, explain in your PR why you think that the proposed solution is better. Even though I might not agree, I will treat everyone with the respect they deserve, and will carefully read through their thoughts and comments.


๐Ÿ”— Where to find more about me and my book

I'd love to hear your thoughts on the book and keep in touch with you.

Send me a tweet @thewizardlucas and let's have a chat!

For discussing any topics related to this book, you can email me at [email protected].

More Repositories

1

dotfiles

๐Ÿค– My collection of highly opinionated and amazing configs
Shell
258
star
2

learnyounode-pt-br

๐Ÿ“– Projeto de Traduรงรฃo do Learnyounode para Portuguรชs Brasileiro
JavaScript
30
star
3

toguro-ipsum

Em pleno 2022, ano da tecnologia, ano de copa do mundo, vocรช ainda tem preconceito com o Toguro Ipsum?
JavaScript
29
star
4

agile-monte-carlo-demo

A few demos showing how to estimate projects using Monte Carlo simulations.
Rust
15
star
5

project-euler-javascript

๐Ÿ’ฏ Project Euler's solutions and boilerplate.
JavaScript
9
star
6

blog

๐Ÿ“ My personal blog.
SCSS
8
star
7

wifi-scanner

๐Ÿ“ถ Node.js wireless networks scanner.
JavaScript
6
star
8

harray

An infinite array implementation in JavaScript.
JavaScript
5
star
9

raspberry-pythagoras

๐Ÿ’ป A twitter bot that answers math questions.
JavaScript
4
star
10

wikilinks

Find paths from one wikipedia page to another.
Go
2
star
11

cypress-date-within-test

Reproducible example for obtaining a Date within test.
JavaScript
2
star
12

discordnarok-timer

A flexible Discord bot for managing MvP timers on Ragnarok Online.
Rust
2
star
13

sugar-sorting

๐Ÿฌ A sorting module for NodeJS
JavaScript
2
star
14

nodejs-server-test-examples

A repository with examples of how to write tests for Node.js servers.
JavaScript
2
star
15

echor

echo written in Rust, as per Systems Programming with Rust by Ken Youens-Clark.
Rust
1
star
16

gobotto

A robots.txt parser written in Go.
Go
1
star
17

probability-with-r

โœ’๏ธSomewhere to keep my notes for probability and R studies.
1
star
18

wren-8080

An Intel 8080 disassembler. Named after Sir Christopher Wren.
JavaScript
1
star
19

newton-8080

An Intel 8080 emulator written in JavaScript.
JavaScript
1
star
20

monte-carlo-forecasts-talk

Code for a talk about making forecasts using Monte Carlo Simulations.
JavaScript
1
star
21

twitter-engagement

TypeScript
1
star
22

synthetics-speed-test

JavaScript
1
star
23

raspberry-gpio-experiments

๐Ÿ”ง A repository for my Raspberry Pi GPIO experiments
JavaScript
1
star