Skip to content

Latest commit

 

History

History
78 lines (63 loc) · 2.21 KB

README.md

File metadata and controls

78 lines (63 loc) · 2.21 KB

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.