mirror of
https://github.com/discordeno/discordeno.git
synced 2026-09-17 08:47:22 +00:00
ts-node hasn't been maintained for a long time now and breaks with TS 7 due to the removal of varius APIs
19 lines
498 B
JavaScript
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;
|