testem 3.8.0 → 3.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/config.js +13 -3
  2. package/package.json +1 -1
package/lib/config.js CHANGED
@@ -140,9 +140,19 @@ class Config {
140
140
  }
141
141
 
142
142
  readJS(configFile, callback) {
143
- this.fileOptions = require(this.resolveConfigPath(configFile));
144
- if (callback) {
145
- callback.call(this);
143
+ let exportedConfig = require(this.resolveConfigPath(configFile));
144
+ if (typeof exportedConfig === 'function') {
145
+ Promise.resolve(exportedConfig()).then(obj => {
146
+ this.fileOptions = obj;
147
+ if (callback) {
148
+ callback.call(this);
149
+ }
150
+ });
151
+ } else {
152
+ this.fileOptions = exportedConfig;
153
+ if (callback) {
154
+ callback.call(this);
155
+ }
146
156
  }
147
157
  }
148
158
 
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "unittest",
8
8
  "browser"
9
9
  ],
10
- "version": "3.8.0",
10
+ "version": "3.10.0",
11
11
  "author": "Toby Ho <airportyh@gmail.com>",
12
12
  "repository": {
13
13
  "type": "git",