We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7b5f620 commit e84a15cCopy full SHA for e84a15c
1 file changed
lib/utils/config-reader.js
@@ -5,7 +5,7 @@ const yaml = require('js-yaml');
5
const path = require('path');
6
const debug = require('debug')('exam:config-reader');
7
8
-const potentialConfigFiles = ['testem.js', 'testem.json'];
+const potentialConfigFiles = ['testem.js', 'testem.json', 'testem.cjs'];
9
10
/**
11
* Given an array of file paths, returns the first one that exists and is
@@ -40,11 +40,14 @@ function _readFileByType(file) {
40
const fileType = file.split('.').pop();
41
switch (fileType) {
42
case 'js':
43
+ case 'cjs':
44
return require(file);
45
case 'json':
46
return fs.readJsonSync(file);
47
case 'yaml':
48
return yaml.load(fs.readFileSync(file));
49
+ default:
50
+ throw new Error(`Unrecognized file extension for: ${file}`);
51
}
52
53
0 commit comments