From f5f0ed03bc0b5b9ffd7ba2b65525fa5e727d3e7b Mon Sep 17 00:00:00 2001 From: DudaGod Date: Wed, 28 Feb 2024 17:43:16 +0300 Subject: [PATCH] fix: ability to run tests in ".jsx" and ".tsx" files by default --- README.md | 4 +--- src/config/defaults.js | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index a32fdc452..cf0c10b7d 100644 --- a/README.md +++ b/README.md @@ -1298,7 +1298,7 @@ The maximum number of tests to be run in one worker before it will be restarted. By default, `hermione` will run all browsers simultaneously. Sometimes (i.e. when using cloud services, such as SauceLabs) you have to limit the amount of browsers that can be run at the same time. This option effectively limits how many browsers `hermione` will try to run in parallel. Default value is `Infinity`. #### fileExtensions -Ability to set file extensions, which hermione will search on the file system. Default value is `[.js]`. +Ability to set file extensions, which hermione will search on the file system. Default value is `[".js", ".mjs", ".ts", ".mts", ".jsx", ".tsx"]`. ### plugins `Hermione` plugins are commonly used to extend built-in functionality. For example, [html-reporter](https://github.com/gemini-testing/html-reporter) and [hermione-safari-commands](https://github.com/gemini-testing/hermione-safari-commands). @@ -1619,8 +1619,6 @@ Using `-r` or `--require` option you can load external modules, which exists in - compilers such as TypeScript via [ts-node](https://www.npmjs.com/package/ts-node) (using `--require ts-node/register`) or Babel via [@babel/register](https://www.npmjs.com/package/@babel/register) (using `--require @babel/register`); - loaders such as ECMAScript modules via [esm](https://www.npmjs.com/package/esm). -Be sure to update [fileExtensions](#fileExtensions) apropriately, if you are planning to import anything other than `.js`. - ### Overriding settings All options can also be overridden via command-line flags or environment variables. Priorities are the following: diff --git a/src/config/defaults.js b/src/config/defaults.js index 325719277..1a27b65e4 100644 --- a/src/config/defaults.js +++ b/src/config/defaults.js @@ -80,7 +80,7 @@ module.exports = { resetCursor: true, strictTestsOrder: false, saveHistoryMode: SAVE_HISTORY_MODE.ALL, - fileExtensions: [".js", ".mjs", ".ts", ".mts"], + fileExtensions: [".js", ".mjs", ".ts", ".mts", ".jsx", ".tsx"], outputDir: null, agent: null, headers: null,