Skip to content

A TypeScript-based password validation tool following Test-Driven Development (TDD) principles, tested with Jest

License

Notifications You must be signed in to change notification settings

tatilimongi/PassChecker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Password Checker

GitHub repo size License Languages Node Version

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

git clone https://github.com/tatilimongi/PassChecker.git
cd PassChecker

Install Dependencies

npm install

Running Tests

The project uses Jest for unit testing. To execute the tests, run:

npm test

Jest Configuration

The jest.config.ts file contains the following configuration:

import type {Config} from '@jest/types';

const config: Config.InitialOptions = {
    preset: 'ts-jest',
    testEnvironment: 'node',
    verbose: true,
    collectCoverage: true,
    collectCoverageFrom: [
        '<rootDir>/src/app/**/*.ts'
    ]
};

export default config;

License

This project is licensed under the MIT License.

About

A TypeScript-based password validation tool following Test-Driven Development (TDD) principles, tested with Jest

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published