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

Commit 2aa56c4

Browse files
committed
Added tests for the page sub-generator
1 parent 9e89597 commit 2aa56c4

File tree

1 file changed

+35
-1
lines changed

1 file changed

+35
-1
lines changed

test/test.js

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@ var expected = [
8686

8787
];
8888

89-
describe('init generator', function () {
89+
90+
// ---- Main generator
91+
describe('main generator', function () {
9092

9193
beforeEach(function (done) {
9294
helpers.testDirectory(path.join(__dirname, 'temp'), function (err) {
@@ -166,3 +168,35 @@ describe('init generator', function () {
166168
});
167169

168170
});
171+
172+
// ---- Page sub-generator
173+
174+
describe('page sub-generator', function () {
175+
beforeEach(function (done) {
176+
helpers.testDirectory(path.join(__dirname, 'temp'), function (err) {
177+
if (err) {
178+
return done(err);
179+
}
180+
181+
this.app = helpers.createGenerator('init:page', [
182+
'../../page'
183+
], ['test-page']);
184+
done();
185+
}.bind(this));
186+
});
187+
188+
it('creates expected files for the page sub-generator', function (done) {
189+
190+
var expectedSCSS = [
191+
'templates/test-page.html'
192+
];
193+
194+
this.app.options['skip-install'] = true;
195+
this.app.run({}, function () {
196+
helpers.assertFiles(expectedSCSS);
197+
done();
198+
});
199+
200+
});
201+
202+
});

0 commit comments

Comments
 (0)