Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/meteor/.mocharc.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"reporter": "spec",
"extension": ["js", "ts", "tsx"],
"require": [
"ts-node/register",
"tsx",
"./tests/setup/chaiPlugins.ts"
],
Comment on lines 5 to 8
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Restore the tsx runtime registration

Swapping ts-node/register for bare tsx stops Mocha from installing any TS loader—the tsx package only exports helpers when required and does not self-register. As soon as Mocha loads ./tests/setup/chaiPlugins.ts (or any .ts spec), Node will try to execute raw TypeScript and blow up with syntax errors. Please require tsx/register (or call require('tsx').register() explicitly) so the tsx transpiler is actually wired in.

Apply this diff to fix the regression:

-		"tsx",
+		"tsx/register",
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"require": [
"ts-node/register",
"tsx",
"./tests/setup/chaiPlugins.ts"
],
// apps/meteor/.mocharc.base.json
{
// …
"require": [
"tsx/register",
"./tests/setup/chaiPlugins.ts"
],
// …
}
🤖 Prompt for AI Agents
In apps/meteor/.mocharc.base.json around lines 5 to 8, the "require" array
currently lists "tsx" which does not self-register a TS loader; replace it with
"tsx/register" (or call require('tsx').register() from a small bootstrap file)
so the tsx transpiler is actually wired before Mocha loads any .ts files; update
the array entry to "tsx/register" (or add a new require entry that points to a
tiny module that calls require('tsx').register() and then requires
./tests/setup/chaiPlugins.ts).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, this is false.

"watch-files": [
Expand Down
14 changes: 0 additions & 14 deletions apps/meteor/.mocharc.definition.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,6 @@

const base = require('./.mocharc.base.json');

/**
* Mocha will run `ts-node` without doing type checking to speed-up the tests. It should be fine as `npm run typecheck`
* covers test files too.
*/

Object.assign(
process.env,
{
TS_NODE_FILES: true,
TS_NODE_TRANSPILE_ONLY: true,
},
process.env,
);

module.exports = {
...base, // see https://github.com/mochajs/mocha/issues/3916
require: [...base.require],
Expand Down
14 changes: 0 additions & 14 deletions apps/meteor/.mocharc.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,6 @@

const base = require('./.mocharc.base.json');

/**
* Mocha will run `ts-node` without doing type checking to speed-up the tests. It should be fine as `npm run typecheck`
* covers test files too.
*/

Object.assign(
process.env,
{
TS_NODE_FILES: true,
TS_NODE_TRANSPILE_ONLY: true,
},
process.env,
);

module.exports = {
...base, // see https://github.com/mochajs/mocha/issues/3916
exit: true,
Expand Down
140 changes: 0 additions & 140 deletions apps/meteor/.scripts/replaceTranslationSprintfParams.ts

This file was deleted.

Loading
Loading