8000 GitHub - kastorcode/javascript-testing-jsexpert at
[go: up one dir, main page]

Skip to content

JavaScript test suite with mocks, stubs, spies, end-to-end with coverage and TDD in the JS Expert.

Notifications You must be signed in to change notification settings

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
🦫 LinkedInInstagram


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/>

0