-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #40 from thibaultyou/test/30-add-tests
[TEST] Add Unit Tests for TypeScript Files
- Loading branch information
Showing
77 changed files
with
4,432 additions
and
562 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/' | ||
] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.