Skip to content

Commit ff7a32d

Browse files
committed
test: Attempt to correctly configure JavaScript
1 parent d3f381f commit ff7a32d

File tree

4 files changed

+12
-10
lines changed

4 files changed

+12
-10
lines changed

.babelrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
["env", {
44
"targets": {
55
"node": 4
6-
}
6+
},
7+
"include": ["transform-regenerator"]
78
}],
89
"flow"
910
],

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"babel-generator": "6.25.0",
1313
"babel-plugin-system-import-transformer": "3.1.0",
1414
"babel-plugin-transform-decorators-legacy": "^1.3.4",
15+
"babel-polyfill": "^6.23.0",
1516
"babel-preset-env": "^1.6.0",
1617
"babel-preset-es2015": "^6.16.0",
1718
"babel-preset-react": "^6.16.0",
@@ -61,7 +62,7 @@
6162
"are-we-flow-yet": "^1.0.0",
6263
"babel-cli": "^6.24.1",
6364
"babel-eslint": "^7.2.3",
64-
"babel-jest": "^20.0.1",
65+
"babel-jest": "^20.0.3",
6566
"babel-plugin-transform-es2015-modules-commonjs": "^6.24.1",
6667
"babel-preset-flow": "^6.23.0",
6768
"chdir": "0.0.0",

src/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
require('babel-polyfill');
12
var fs = require('fs'),
23
_ = require('lodash'),
34
sort = require('./sort'),

src/output/html.js

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,13 @@ var mergeConfig = require('../merge_config');
2323
* streamArray(output).pipe(vfs.dest('./output-directory'));
2424
* });
2525
*/
26-
function html(comments: Array<Comment>, config: Object = {}) {
27-
return mergeConfig(config).then((config: DocumentationConfig) => {
28-
var themePath = '../default_theme/';
29-
if (config.theme) {
30-
themePath = path.resolve(process.cwd(), config.theme);
31-
}
32-
return require(themePath)(comments, config);
33-
});
26+
async function html(comments: Array<Comment>, config: Object = {}) {
27+
const mergedConfig: DocumentationConfig = await mergeConfig(config);
28+
var themePath = '../default_theme/';
29+
if (mergedConfig.theme) {
30+
themePath = path.resolve(process.cwd(), mergedConfig.theme);
31+
}
32+
return require(themePath)(comments, mergedConfig);
3433
}
3534

3635
module.exports = html;

0 commit comments

Comments
 (0)