/
test.js
69 lines (55 loc) · 1.56 KB
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/*global describe beforeEach it*/
var path = require('path');
var helpers = require('yeoman-generator').test;
var gen = null;
describe('closure generator', function () {
beforeEach(function (done) {
helpers.testDirectory(path.join(__dirname, 'temp'), function (err) {
if (err) {
return done(err);
}
this.app = helpers.createGenerator('closure:app', [
'../../app'
]);
done();
}.bind(this));
});
it('creates expected files', function (done) {
var expected = [
// add files you expect to exist here.
'.jshintrc',
'.editorconfig',
'bower.json',
'package.json',
'Gruntfile.js',
'app/index.html',
];
this.app.options['skip-install'] = true;
this.app.run({}, function () {
helpers.assertFiles(expected);
done();
});
});
});
// describe('Webapp generator test', function () {
// before(helpers.before(path.join(__dirname, './temp')));
// it('the generator can be required without throwing', function () {
// // not testing the actual run of generators yet
// this.app = require('../app');
// });
// it('runs sucessfully', function(done) {
// helpers.runGenerator('closure', done);
// });
// it('creates expected files', function (done) {
// var expected = [
// ['component.json', /"name": "temp"/],
// ['package.json', /"name": "temp"/],
// 'Gruntfile.js',
// 'app/index.html'
// ];
// gen.run({}, function () {
// helpers.assertFiles(expected);
// done();
// });
// });
// });