fix(cli): correct Redis datasource name in test-helper, nycrc, and datasource files#2286
fix(cli): correct Redis datasource name in test-helper, nycrc, and datasource files#2286Tyagi-Sunny wants to merge 2 commits intomasterfrom
Conversation
…tasource files correct Redis datasource name in test-helper, nycrc, and datasource files 2285
There was a problem hiding this comment.
Pull Request Overview
This PR fixes the incorrect Redis datasource naming in various templates and configuration files. It updates the test-helper to correctly bind the Redis or Auth cache datasource, refines the .nycrc configuration, and adjusts datasource template injection to rely on the new naming conventions.
- Updated test-helper.ts to build the correct import mappings and binding configurations.
- Refined the datasource templates (redis.datasource.ts.tpl and name.datasource.ts.tpl) to choose the correct datasource name based on project properties.
- Adjusted the .nycrc configuration file to use a stricter coverage check.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/cli/src/generators/microservice/templates/src/tests/acceptance/test-helper.ts.ejs | Adjusted dynamic import mapping and binding for Redis/Auth datasource based on project configuration. |
| packages/cli/src/generators/microservice/templates/.nycrc | Revised configuration settings to improve coverage reporting. |
| packages/cli/src/generators/microservice/index.ts | Corrected assignment of baseServiceCacheName using a fallback to 'redis' when necessary. |
| packages/cli/src/generators/datasource/templates/redis.datasource.ts.tpl | Updated template to use the correct datasource name from project properties. |
| packages/cli/src/generators/datasource/templates/name.datasource.ts.tpl | Modified template to select between a configured store name and a default value. |
|
|
||
| <% if (project.facade || project.baseServiceCacheName) { -%> | ||
| <% if (project.serviceDependency && project.baseServiceCacheName ) { -%> | ||
| app.bind(`datasources.config.${<%= project.baseServiceCacheName %>}`).to({ |
There was a problem hiding this comment.
but we are binding redis anyways on line 84? do we still need it?
| <% | ||
| const importMap = {}; | ||
|
|
||
| if (project.baseServiceDSList) { |
There was a problem hiding this comment.
why is this logic in template? this should be in the generator
|



changes made are as follows:
#2285
Description
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
Fixes # (issue)
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Checklist: