Skip to content

kastorcode/javascript-testing-jsexpert

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

JavaScript Testing JS Expert

πŸ‘¨β€πŸ’» Developed by Matheus Ramalho de Oliveira
πŸ—οΈ Brazilian Software Engineer
βœ‰οΈ kastorcode@gmail.com
🦫 LinkedIn β€’ Instagram


This repository contains a comprehensive collection of JavaScript testing practices and examples, covering various testing methodologies and techniques. The project is structured to help developers understand and implement different testing approaches in JavaScript applications.


πŸ—‚οΈ Project Structure

The project is organized into several modules, each focusing on specific testing concepts:

  • 01-mocks: Examples and implementations of mocking in JavaScript tests
  • 02-stubs: Demonstration of stub usage in testing
  • 03-spies: Implementation of test spies and their applications
  • 04-coverage-e2e: End-to-end testing examples with coverage reporting
  • 05-tdd-project: A simple project built using Test-Driven Development (TDD) principles

πŸš€ Getting Started

Prerequisites

  • Node.js (version 18 or higher)
  • npm or yarn package manager

Installation

  1. Clone this repository:
git clone https://github.com/kastorcode/javascript-testing-jsexpert.git
cd javascript-testing-jsexpert
  1. Install dependencies for each module as needed:
cd [module-name]
npm install
# or
yarn install

πŸ§ͺ Running Tests

Each module contains its own test suite. To run tests for a specific module:

cd [module-name]

npm test
# or
yarn test

npm test:cov
# or
yarn test:cov

πŸ“š Learning Objectives

  • Understanding and implementing different types of test doubles (Mocks, Stubs, Spies)
  • Writing effective unit tests
  • Implementing end-to-end testing
  • Following Test-Driven Development practices
  • Measuring and improving test coverage
  • Best practices in JavaScript testing

<kastor.code/>