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.
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.
- An admin password must also contain at least one number.
├── 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
Make sure you have Node.js and npm installed on your machine.
git clone https://github.com/tatilimongi/PassChecker.git
cd PassChecker
npm install
The project uses Jest for unit testing. To execute the tests, run:
npm test
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;
This project is licensed under the MIT License.