Skip to content

Commit

Permalink
Merge pull request #40 from thibaultyou/test/30-add-tests
Browse files Browse the repository at this point in the history
[TEST] Add Unit Tests for TypeScript Files
  • Loading branch information
thibaultyou authored Oct 25, 2024
2 parents 834038a + 4c7e5ca commit 78a2648
Show file tree
Hide file tree
Showing 77 changed files with 4,432 additions and 562 deletions.
5 changes: 5 additions & 0 deletions .env.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ANTHROPIC_API_KEY=test-anthropic-key
FORCE_REGENERATE=false
CLI_ENV=cli
NODE_ENV=test
LOG_LEVEL=error
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@
dist/
node_modules/
archive/
coverage/

# Ignore local database
*.sqlite

# Ignore aider files
.aider*

# Ignore macOS files
.DS_Store

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,9 @@ prompt-library-cli execute --help
- [Git Branch Name Generator](prompts/git_branch_name_generator/README.md) - Generates optimized git branch names based on project context and user requirements
- [Git Commit Message Agent](prompts/git_commit_message_agent/README.md) - Generates precise and informative git commit messages following Conventional Commits specification
- [GitHub Issue Creator](prompts/github_issue_creator_agent/README.md) - Creates comprehensive and actionable GitHub issues based on provided project information
- [Software Architect Visionary](prompts/software_architect_agent/README.md) - Analyzes user requirements and creates comprehensive software specification documents
- [Software Architect Code Reviewer](prompts/software_architect_code_reviewer/README.md) - Generates comprehensive pull requests with architectural analysis and optimization suggestions
- [Software Architect Specification Creator](prompts/software_architect_spec_creator/README.md) - Creates comprehensive software specification documents based on user requirements
- [Software Architect Visionary](prompts/software_architect_agent/README.md) - Analyzes user requirements and creates comprehensive software specification documents
- [Software Development Expert Agent](prompts/software_dev_expert_agent/README.md) - Provides expert, adaptive assistance across all aspects of the software development lifecycle.

</details>
Expand All @@ -143,8 +143,8 @@ prompt-library-cli execute --help
<details>
<summary><strong>Healthcare</strong></summary>

- [Psychological Support and Therapy Agent](prompts/psychological_support_agent/README.md) - Provides AI-driven psychological support and therapy through digital platforms
- [Health Optimization Agent](prompts/health_optimization_agent/README.md) - Generates personalized, adaptive health optimization plans based on comprehensive user data analysis
- [Psychological Support and Therapy Agent](prompts/psychological_support_agent/README.md) - Provides AI-driven psychological support and therapy through digital platforms

</details>
<details>
Expand Down
23 changes: 17 additions & 6 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
testMatch: ['**/tests/**/*.test.ts'],
globals: {
'ts-jest': {
setupFiles: ['<rootDir>/jest.setup.ts'],
testMatch: ['<rootDir>/src/**/__tests__/**/*.test.ts'],
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/src/$1'
},
transform: {
'^.+\\.ts?$': ['ts-jest', {
tsconfig: 'tsconfig.test.json'
}
}
};
}]
},
collectCoverage: true,
coverageDirectory: 'coverage',
coveragePathIgnorePatterns: [
'/node_modules/',
'/dist/'
]
};
10 changes: 10 additions & 0 deletions jest.setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import * as path from 'path';
import dotenv from 'dotenv';

const originalEnv = { ...process.env };
const envTestPath = path.resolve(__dirname, '.env.test');
dotenv.config({ path: envTestPath });

process.env.NODE_ENV = 'test';

export { originalEnv };
181 changes: 175 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 78a2648

Please sign in to comment.