Skip to content
This repository was archived by the owner on Apr 24, 2019. It is now read-only.

Commit f7893b5

Browse files
sergiopvilarKahlil Lechelt
authored andcommitted
Added tests for module and jqueryplugin sub-generators
1 parent 9e3b7db commit f7893b5

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed

test/test.js

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,3 +200,67 @@ describe('page sub-generator', function () {
200200
});
201201

202202
});
203+
204+
// ---- Module sub-generator
205+
206+
describe('module sub-generator', function () {
207+
beforeEach(function (done) {
208+
helpers.testDirectory(path.join(__dirname, 'temp'), function (err) {
209+
if (err) {
210+
return done(err);
211+
}
212+
213+
this.app = helpers.createGenerator('init:module', [
214+
'../../module'
215+
], ['test']);
216+
done();
217+
}.bind(this));
218+
});
219+
220+
it('creates expected files for the module sub-generator', function (done) {
221+
222+
var expected = [
223+
'js/modules/test.js'
224+
];
225+
226+
this.app.options['skip-install'] = true;
227+
this.app.run({}, function () {
228+
helpers.assertFiles(expected);
229+
done();
230+
});
231+
232+
});
233+
234+
});
235+
236+
// ---- Jqueryplugin sub-generator
237+
238+
describe('jqueryplugin sub-generator', function () {
239+
beforeEach(function (done) {
240+
helpers.testDirectory(path.join(__dirname, 'temp'), function (err) {
241+
if (err) {
242+
return done(err);
243+
}
244+
245+
this.app = helpers.createGenerator('init:jqueryplugin', [
246+
'../../jqueryplugin'
247+
], ['test']);
248+
done();
249+
}.bind(this));
250+
});
251+
252+
it('creates expected files for the jqueryplugin sub-generator', function (done) {
253+
254+
var expected = [
255+
'js/plugins/jquery.test.js'
256+
];
257+
258+
this.app.options['skip-install'] = true;
259+
this.app.run({}, function () {
260+
helpers.assertFiles(expected);
261+
done();
262+
});
263+
264+
});
265+
266+
});

0 commit comments

Comments
 (0)