Meteor + Mocha : How are test files selected and passed into meteortesting:mocha?

I’m trying to debug an issue with Meteor + Mocha (+ typescript). It seems as though unit tests written in typescript are not recognized. I’d like to understand how Mocha loads tests but I keep running into a wall.

I see within tools/isobuilds/test-files.js there is the function isTestFilePath which matches a path against a regex. But the only reference I see is in compiler-plugin.js, which seems to be meant for assets.

Does anyone know how tests are loaded? The documentation is pretty sparse as far as the “how.”

I think I know the issue. The issue is not with meteor or mocha. The issue is with barbatus_typescript.

The compiler starts before typescript sets the environment. Since the environment is null it does not see the TEST_METADATA environment variable.

I think this is worth a ticket on GitHub.