An open API service indexing awesome lists of open source software.

https://github.com/iand1013/javascript-testing-course

Hands-on project from Mastering JavaScript Unit Testing by Mosh Hamedani. Covers unit testing fundamentals, mocking, code quality, and automation using modern tools like Vitest, TypeScript, ESLint, and Husky.
https://github.com/iand1013/javascript-testing-course

self-learning testing

Last synced: 9 months ago
JSON representation

Hands-on project from Mastering JavaScript Unit Testing by Mosh Hamedani. Covers unit testing fundamentals, mocking, code quality, and automation using modern tools like Vitest, TypeScript, ESLint, and Husky.

Awesome Lists containing this project

README

          

# JavaScript Testing Course

A comprehensive project demonstrating JavaScript testing practices using modern tools and frameworks. This project is part of the "Mastering JavaScript Unit Testing" course by [Mosh Hamedani](https://codewithmosh.com/p/mastering-javascript-unit-testing).

## ๐Ÿ“š About the Course

This project is a code-along companion to the "Mastering JavaScript Unit Testing" course, which is designed to equip you with the skills to write maintainable, robust, and valuable unit tests for your JavaScript applications.

### Course Details
- **Duration**: 4 Hours
- **Level**: Beginner to Pro
- **Lessons**: 70
- **Instructor**: Mosh Hamedani (20+ years of software engineering experience)

### What You'll Learn
- Fundamentals of unit testing and its significance in JavaScript development
- Core techniques including positive, negative, and boundary testing
- Mocking and dependency isolation
- Code quality improvement with static analysis tools
- TypeScript integration for type safety
- Automated quality checks with Husky
- VSCode shortcuts for efficient testing
- Working with matchers and crafting precise assertions
- Breaking dependencies with mocks
- Improving code quality with static analysis

### Prerequisites
- Familiarity with modern JavaScript features (arrow functions, modules, promises, etc.)
- No prior knowledge of unit testing required

For the complete course content and more learning resources, visit [Code with Mosh](https://codewithmosh.com/p/mastering-javascript-unit-testing).

## ๐Ÿš€ Features

- Unit testing with Vitest
- TypeScript support
- Code formatting with Prettier
- Linting with ESLint
- Git hooks with Husky
- Code coverage reporting
- Mocking examples

## ๐Ÿ› ๏ธ Tech Stack

- [Vitest](https://vitest.dev/) - Modern test runner
- [TypeScript](https://www.typescriptlang.org/) - Type safety
- [Vite](https://vitejs.dev/) - Build tool
- [ESLint](https://eslint.org/) - Code linting
- [Prettier](https://prettier.io/) - Code formatting
- [Husky](https://typicode.github.io/husky/) - Git hooks
- [lint-staged](https://github.com/okonet/lint-staged) - Run linters on git staged files

## ๐Ÿ“ฆ Installation

1. Clone the repository:
```bash
git clone [your-repo-url]
cd javascript-testing-course
```

2. Install dependencies:
```bash
npm install
```

## ๐Ÿงช Available Scripts

- `npm run dev` - Start development server
- `npm run build` - Build for production
- `npm run preview` - Preview production build
- `npm test` - Run tests
- `npm run test:ui` - Run tests with UI
- `npm run coverage` - Generate test coverage report
- `npm run format` - Format code with Prettier
- `npm run lint` - Lint code with ESLint
- `npm run check-types` - Check TypeScript types

## ๐Ÿ“š Project Structure

```
โ”œโ”€โ”€ src/
โ”‚ โ”œโ”€โ”€ libs/ # Library code
โ”‚ โ”œโ”€โ”€ core.js # Core functionality
โ”‚ โ”œโ”€โ”€ intro.js # Introduction examples
โ”‚ โ””โ”€โ”€ mocking.js # Mocking examples
โ”œโ”€โ”€ tests/ # Test files
โ”œโ”€โ”€ .husky/ # Git hooks
โ””โ”€โ”€ config files # Various configuration files
```

## ๐Ÿ”ง Configuration

The project uses several configuration files:

- `vitest.config.js` - Vitest configuration
- `tsconfig.json` - TypeScript configuration
- `.eslintrc.json` - ESLint configuration
- `.prettierrc.json` - Prettier configuration
- `.lintstagedrc.json` - lint-staged configuration