Mô tả

25.09.2023 - New section for CICD with GitHub actions and Docker

1.03.2023 - Complete remaster of the course with the latest Jest and TypeScript features

A must have skill for senior developers

Typescript is getting more and more popularity and it is a required skill for many IT jobs. It's key feature is type safety, thus preventing bugs.

But yes another skill is very important for any programming job: unit testing. Combining these two techniques will result in solid, robust and bug free code.

This course will go beyond the basics of unit testing and teach you all you need to write real world, complex testing suites for NodeJs and Typescript applications using the most popular JavaScript testing library: Jest.

Using Jest as an unit testing library provides many advantages:

  • Unitary unit testing library for running and structuring tests

  • Extensive mocking, stubbing and spying capabilities

  • Powerful matchers to create simple to read tests

  • Jest ships as one unitary NPM package

  • Jest is the default choice for TypeScript React projects

Why unit testing NodeJs apps?

Unit testing usually adds a lot to a code base, two or tree times in some cases. This also means that a lot of time needs to be invested in writing and setting up tests. But all this effort pays of: time, effort and headache of fixing bugs can be used for more fun activities.

What you will get from this course:

  • setup NodeJs and Typescript projects from scratch

  • implement unit testing with Jest

  • learn about unit testing configuration with parameters like: roots, transform, testRegex or verbose

  • learn about Jest test suites structure: describe with value, test, descriptions, hooks like beforeEach

  • basic and advanced assertions, comparing primitive types, objects or even errors

  • instantiating test double objects like mocks, stubs, spies or fakes.

  • write complex mock objects which can be used with "strange" JavaScript libraries.

  • inject doubles: directly inside the constructor, over the module or even using the objects prototype

  • learn about deep mocks and matchers to make your tests even better

  • integration tests for a NodeJs server application

  • Conditionally and asynchronously skip tests

Dedicated sections on unit testing mocks:

  • Jest mocks, spies

  • How to use stubs

  • London/Chicago testing approach, with the advantages and disadvantages of each one

In this course you will learn how to use Test Driven Development (TDD):

  • Analyze the advantages of TDD

  • Hands-on practice with a great coding kata: password checker

Separate section on Jest Integration tests for Rest APIs:

  • learn how to setup integration tests

  • learn the difference between integration tests and unit tests

  • write integration tests for a Rest API with Jest

Dedicated section on Jest React unit testing:

  • How to test for React components with Jest

  • How to test React async code

  • How to debug React Typescript apps

The examples used in the course follow very high coding guidelines for Typescript, NodeJs and React. Async/await syntax is used for clear and concise code, and of course, you will see how to test asynchronous code, on server, but also in the front end.

Course advantages:

  • Respect for your time: most of the time of the instructor typing is cut off, the course is focused on unit tests and Jest explanations

  • Concise: learn only what you need, no fillers to make the course falsely more appealing

  • Experienced and programming active instructor: a great teacher never looses touch with the industry. This is especially true for software development, where the industry is so dynamic. This helps the instructor stay up to date with the best coding guidelines and present you the challenging parts, not the "hello world"

  • Organized course structure: six parts, progressive approach, consistent content

  • Code changes in each lecture on Git with code diffs: this will help you get an concise overview of the lecture and correct in case you missed something

  • Big font, dark background, fullHD content, this way it is readable even on a small screen or even tablet.

  • Lifetime access

  • Certificate of completion to present to your current or prospective employer

Do you want your Typescript or NodeJs code to have the best quality, and your project to be safe?

Enroll and start writing your tests in 10 minutes!



Bạn sẽ học được gì

Basics of TypeScript unit testing with Jest

Integration tests with TypeScript

Test Driven Development (TDD) with Jest

Unit testing React with TypeScript and Jest

CICD with GitHub Actions and Docker

Jest - the basics: hooks, assertions, matchers

Jest - the advanced parts: aliases, custom matchers, snapshots

Advanced unit testing techniques using Jest

Database operations testing with Docker and Jest

Yêu cầu

  • Basic knowledge of Typescript
  • Basic knowledge of NodeJs
  • Basic knowledge of React (for the React part)

Nội dung khoá học

14 sections

Getting started

5 lectures
How to take this course
04:36
Let's connect!
00:07
Tools we will need
01:41
Why we need tests
04:04
Course resources access
00:06

Basics of testing with Jest

8 lectures
Section intro
00:49
Jest introduction
02:25
Jest project setup
10:02
Structure of an unit test
04:36
Jest assertions and matchers
12:09
Multiple tests structure
05:45
Parametrized tests
05:19
Jest basics quiz
3 questions

Intermediate testing topics

8 lectures
Section intro
01:17
F.I.R.S.T. principles
05:09
Jest hooks
07:35
Testing for errors
10:22
Jest aliases and watch mode
06:09
VSCode debug configuration
07:01
Coverage
06:56
Jest intermediate topics quizz
5 questions

Test Driven Development with Jest and TypeScript

8 lectures
Section intro
01:34
Test Driven Development intro
03:31
Coding Katas - password checker
02:45
PassChecker setup
05:26
PassChecker Iteration 1
08:50
PassChecker Iteration 2
11:27
PassChecker Iteration 3
09:04
Game coding exercise
1 question

Test doubles in Jest

7 lectures
Section intro
01:04
What are test doubles
04:32
Stubs
06:34
Fakes
06:00
Mocks
10:28
Spies
11:40
Mocking modules
11:25

Test doubles in practice

13 lectures
Section intro
08:36
Project presentation
04:50
Project installation
05:24
Testing arrays
16:52
Mocking consumer classes
15:03
Injecting mocks
14:16
Explaining tests
09:48
Event based app - tests
12:01
Server tests 1 - setup
12:11
Server tests 2 - advanced debugging
09:11
Server tests 3 - prototype spies
10:17
Finishing the tests
06:17
High mock tests conclusion
04:09

Low mocks tests

5 lectures
Section intro
02:48
Building testing wrappers
08:40
Setup tests
12:34
Finishing tests
07:36
Low mock tests conclusion
03:56

Integration testing

4 lectures
Section intro
00:54
Understanding integration tests
04:59
Integration tests setup
12:02
Writing integration tests
12:49

Other testing topics

7 lectures
Section intro
00:55
Environment variables
03:30
Multiple test configurations
03:25
Snapshot testing
07:02
Custom matchers
08:36
Exploring the NodeJs test runner module
13:03
Testing frameworks comparison
04:45

React unit testing with Jest

8 lectures
Section intro
02:58
Simple React Typescript app setup
05:25
Generics, state, props
09:22
What we will test
06:58
First tests - rendering React TypeScript components
07:56
React testing library: query for elements
10:47
Testing user interaction
08:20
Testing async updates
12:55

CICD with GitHub actions and Docker

6 lectures
Section intro
03:54
Section resources
00:06
GiHub actions
06:53
Pipeline with Jest tests
06:54
Local DB testing with Docker
08:29
Docker on Github actions
03:26

Course conclussions

2 lectures
Choosing a work project
06:20
Ending lecture
01:34

TypeScript recap

24 lectures
TypeScript presentation
04:13
Running TS code
03:15
Types in Typescript
04:45
User defined types
05:52
Optional properties
03:52
Type guards
04:05
Compiler options
06:59
Classes
06:39
Access modifiers
04:07
Inheritance
05:26
Interfaces
04:10
Generics
07:03
Promises
04:21
Modules
05:00
Strict mode
06:28
Undefined, null, never, unknown
07:51
Enums and Swith statements
06:12
Runnnig on NodeJs
11:18
Debugging node TypeScript
02:43
Run in browser
09:07
TypeScript with Webpack
12:59
Decorators introduction
13:55
Method decorators
05:23
Outro
00:17

Ending section

1 lectures
Bonus
00:24

Đánh giá của học viên

Chưa có đánh giá
Course Rating
5
0%
4
0%
3
0%
2
0%
1
0%

Bình luận khách hàng

Viết Bình Luận

Bạn đánh giá khoá học này thế nào?

image

Đăng ký get khoá học Udemy - Unica - Gitiho giá chỉ 50k!

Get khoá học giá rẻ ngay trước khi bị fix.