I've been unit-testing some code that depends on interfaces and classes I am unable to import, but can add to intellisense through d.ts files. Despite having the "include" property in my tsconfig mention those files, I get errors about how TypeScript couldn't compile because it couldn't find any of those interfaces I am using.
My tsconfig:
{
"compilerOptions": {
"target": "es6",
"module": "CommonJS",
"esModuleInterop": true,
"sourceMap": false,
"downlevelIteration": true,
},
"include":
[
"_MainSource/**/*",
"Tests/**/*",
"@typeDefs/**/*"
],
}
The error I get:
error TS2503: Cannot find namespace 'RPG'.
My current test command:
mocha -r ts-node/register Tests/**/*.ts
I have tried adding a 'ts-node --files' to the test command, getting me what you see here:
mocha -r ts-node/register 'ts-node --files' Tests/**/*.ts
But then I get errors about how TS can't find ts-node (even though ts-node is installed, and the original command works fine on code that doesn't rely on the RPG namespace).