https://github.com/tatilimongi/passchecker
A TypeScript-based password validation tool following Test-Driven Development (TDD) principles, tested with Jest
https://github.com/tatilimongi/passchecker
best-practices jest password-validation software-testing tdd tdd-kata testing typescript unit-testing
Last synced: 2 months ago
JSON representation
A TypeScript-based password validation tool following Test-Driven Development (TDD) principles, tested with Jest
- Host: GitHub
- URL: https://github.com/tatilimongi/passchecker
- Owner: tatilimongi
- License: mit
- Created: 2025-02-07T22:05:45.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-08T01:13:55.000Z (over 1 year ago)
- Last Synced: 2025-04-03T13:21:21.667Z (about 1 year ago)
- Topics: best-practices, jest, password-validation, software-testing, tdd, tdd-kata, testing, typescript, unit-testing
- Language: TypeScript
- Homepage:
- Size: 43.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Password Checker




## Description
This project is a **Password Checker** implemented in **TypeScript**. It was developed as an exercise to practice **Test-Driven Development (TDD)** and **Jest** for unit testing.
## Password Validation Rules
A password is **invalid** if:
- It has **less than 8 characters**.
- It **does not contain an uppercase letter**.
- It **does not contain a lowercase letter**.
### Additional Requirement for Admin Passwords
- An **admin password must also contain at least one number**.
## Project Structure
```
├── src
│ ├── app
│ │ ├── PasswordChecker.ts # Implementation of the password checker
│ ├── test
│ │ ├── PasswordChecker.test.ts # Jest test cases
├── node_modules/ # Dependencies (not included in the repository)
├── coverage/ # Test coverage reports (generated by Jest)
├── jest.config.ts # Jest configuration
├── package.json # Project dependencies and scripts
├── tsconfig.json # TypeScript configuration
├── LICENSE # MIT License
└── README.md # Project documentation
```
## Installation and Setup
### Prerequisites
Make sure you have **Node.js** and **npm** installed on your machine.
### Clone the Repository
```sh
git clone https://github.com/tatilimongi/PassChecker.git
cd PassChecker
```
### Install Dependencies
```sh
npm install
```
## Running Tests
The project uses **Jest** for unit testing. To execute the tests, run:
```sh
npm test
```
## Jest Configuration
The `jest.config.ts` file contains the following configuration:
```typescript
import type {Config} from '@jest/types';
const config: Config.InitialOptions = {
preset: 'ts-jest',
testEnvironment: 'node',
verbose: true,
collectCoverage: true,
collectCoverageFrom: [
'/src/app/**/*.ts'
]
};
export default config;
```
## License
This project is licensed under the **MIT License**.