Files
discordeno/.mocharc.cjs
T
Fleny fca3cbba5e build(dev-deps): Replace ts-node with tsx (#5261)
ts-node hasn't been maintained for a long time now and breaks with TS 7 due to the removal of varius APIs
2026-08-03 13:55:10 +05:30

19 lines
498 B
JavaScript

// @ts-check
// If we are running in Bun or Deno, they have native TypeScript support with .js imports, node requires .ts imports
const supportsTypescript = 'Bun' in globalThis || 'Deno' in globalThis;
/** @type {import("mocha").MochaInstanceOptions & Record<string, unknown>} */
const mochaConfig = {
timeout: 2000,
'watch-extensions': 'ts',
'watch-files': ['src', 'tests'],
};
if (!supportsTypescript) {
// --import=tsx
mochaConfig.import = ['tsx'];
}
module.exports = mochaConfig;