-
Notifications
You must be signed in to change notification settings - Fork 665
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add possibility to load config file from cjs file (#7614)
[closes #6911] ## Purpose The newest NodeJS version requires indicating modules loading framework to use (CommonJS or ESM) by using extension file. `.js` extension is now for using ESM and `.cjs` for CommonJS. Currently, from newest NodeJS, it is not possible to use CommonJS framework for TestCafe global configuration file (`.testcaferc.js`), because this file has to be named `.testcaferc.cjs` ## Approach This PR allows loading `.testcaferc.cjs` as TestCafe global configuration file. --------- Co-authored-by: Damien Guérin <damien.guerin@lyra-network.com>
- Loading branch information
Showing
5 changed files
with
24 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
export const JS_CONFIGURATION_EXTENSION = '.js'; | ||
export const JSON_CONFIGURATION_EXTENSION = '.json'; | ||
export const CONFIGURATION_EXTENSIONS = [JS_CONFIGURATION_EXTENSION, JSON_CONFIGURATION_EXTENSION]; | ||
enum Extensions { | ||
js = '.js', | ||
json = '.json', | ||
cjs = '.cjs', | ||
} | ||
|
||
export default Extensions; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters