Skip to content

Commit f5b0724

Browse files
committed
Fix tests
1 parent bae9579 commit f5b0724

File tree

7 files changed

+495
-32
lines changed

7 files changed

+495
-32
lines changed

.eslintrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@
8080
"handle-callback-err": 0
8181
},
8282
"env": {
83-
"node": true
83+
"node": true,
84+
"es6": true
8485
}
8586
}

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
language: node_js
22
node_js:
33
- stable
4-
- v4
4+
- 6

Gulpfile.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,15 @@ function lint () {
1616
.pipe(eslint.failAfterError());
1717
}
1818

19-
gulp.task('test', gulp.series([lint]), function () {
19+
function test () {
2020
return gulp
2121
.src('test/test.js')
2222
.pipe(mocha({
2323
ui: 'bdd',
2424
reporter: 'spec',
2525
timeout: typeof v8debug === 'undefined' ? 20000 : Infinity // NOTE: disable timeouts in debug
2626
}));
27-
});
27+
}
28+
29+
exports.lint = lint;
30+
exports.test = gulp.series(lint, test);

generators/app/index.js

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
11
'use strict';
2-
var yeoman = require('yeoman-generator');
2+
var Generator = require('yeoman-generator');
33
var slugify = require('underscore.string').slugify;
44
var normalizeUrl = require('normalize-url');
55

66
function filterProjectName (name) {
77
return slugify(name.replace(/^testcafe(-|\s)reporter(-|\s)/i, ''));
88
}
99

10-
module.exports = yeoman.generators.Base.extend({
11-
prompting: function () {
12-
var done = this.async();
13-
var gen = this;
14-
10+
module.exports = class extends Generator {
11+
prompting () {
1512
var prompts = [
1613
{
1714
name: 'reporterName',
@@ -43,16 +40,14 @@ module.exports = yeoman.generators.Base.extend({
4340
}
4441
];
4542

46-
this.prompt(prompts, function (props) {
47-
gen.props = props;
48-
49-
done();
50-
});
51-
},
52-
53-
writing: function () {
54-
var gen = this;
43+
return this
44+
.prompt(prompts)
45+
.then(props => {
46+
this.props = props;
47+
});
48+
}
5549

50+
writing () {
5651
var tmplProps = {
5752
author: this.user.git.name(),
5853
email: this.user.git.email(),
@@ -74,12 +69,12 @@ module.exports = yeoman.generators.Base.extend({
7469
this.fs.copyTpl(this.templatePath() + '/**/!(*.png)', this.destinationPath(), tmplProps);
7570
this.fs.copy(this.templatePath() + '/**/*.png', this.destinationPath());
7671

77-
Object.keys(unescaped).forEach(function (escaped) {
78-
gen.fs.move(gen.destinationPath(escaped), gen.destinationPath(unescaped[escaped]));
72+
Object.keys(unescaped).forEach(escaped => {
73+
this.fs.move(this.destinationPath(escaped), this.destinationPath(unescaped[escaped]));
7974
});
80-
},
75+
}
8176

82-
install: function () {
77+
install () {
8378
this.installDependencies({ bower: false });
8479
}
85-
});
80+
};

0 commit comments

Comments
 (0)