Closed appersonj closed 6 years ago
Hey @appersonj, Have you tried the most recent version v2.0.0 is the issue still present? We updated to the newest ts-node so it's possible it have been fixed.
I worked around it by running tsnode directly. I'll try tsmocha again on the next project.
Ok cool, so I'm closing for now as only you could confirm the issue solved. I will reopen when there is someone else hitting the same issue.
I have several files in src/environments/ directory, such as environment.alternate.ts:
export const environment = { production: false, envName : "alternate", version: "${project.version}", extendedVersion: "${extended-version}" };
These have template macros that are NOT intended to be expanded at compile time.When I run:
npx ts-mocha -p . 'src/**/*.test.ts'
It expands the variables (incorrectly) in the environments files, ACTUALLY MODIFYING THOSE FILES
Note : the following command does not modify the files, so I will fall back to using ts-node directly
npx mocha --require ts-node/register 'src/**/*.test.ts'