Skip to content

Commit c131bc4

Browse files
committed
make tests more dry
1 parent 4bf0750 commit c131bc4

File tree

1 file changed

+14
-28
lines changed

1 file changed

+14
-28
lines changed

test/test-file-creation.js

Lines changed: 14 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,16 @@ describe('angular-fullstack generator', function () {
6161
});
6262
}
6363

64+
function runE2E() {
65+
this.timeout(240000); // 4 minutes
66+
gen.run({}, function () {
67+
exec('grunt test:e2e', function (error, stdout, stderr) {
68+
expect(stdout, 'Client tests failed \n' + stdout).to.contain('0 failures');
69+
done();
70+
});
71+
});
72+
};
73+
6474
function runTest(cmd, self, cb) {
6575
var args = Array.prototype.slice.call(arguments),
6676
endpoint = (args[3] && typeof args[3] === 'string') ? args.splice(3, 1)[0] : null,
@@ -348,13 +358,7 @@ describe('angular-fullstack generator', function () {
348358
});
349359

350360
it('should run e2e tests successfully', function(done) {
351-
this.timeout(240000); // 4 minutes
352-
gen.run({}, function () {
353-
exec('grunt test:e2e', function (error, stdout, stderr) {
354-
expect(stdout, 'Client tests failed \n' + stdout).to.contain('0 failures');
355-
done();
356-
});
357-
});
361+
runE2E();
358362
});
359363
});
360364

@@ -410,13 +414,7 @@ describe('angular-fullstack generator', function () {
410414
});
411415

412416
it('should run e2e tests successfully', function(done) {
413-
this.timeout(240000); // 4 minutes
414-
gen.run({}, function () {
415-
exec('grunt test:e2e', function (error, stdout, stderr) {
416-
expect(stdout, 'Client tests failed \n' + stdout).to.contain('0 failures');
417-
done();
418-
});
419-
});
417+
runE2E();
420418
});
421419
});
422420

@@ -473,13 +471,7 @@ describe('angular-fullstack generator', function () {
473471
});
474472

475473
it('should run e2e tests successfully', function(done) {
476-
this.timeout(240000); // 4 minutes
477-
gen.run({}, function () {
478-
exec('grunt test:e2e', function (error, stdout, stderr) {
479-
expect(stdout, 'Client tests failed \n' + stdout).to.contain('0 failures');
480-
done();
481-
});
482-
});
474+
runE2E();
483475
});
484476
});
485477

@@ -528,13 +520,7 @@ describe('angular-fullstack generator', function () {
528520
});
529521

530522
it('should run e2e tests successfully', function(done) {
531-
this.timeout(240000); // 4 minutes
532-
gen.run({}, function () {
533-
exec('grunt test:e2e', function (error, stdout, stderr) {
534-
expect(stdout, 'Client tests failed \n' + stdout).to.contain('0 failures');
535-
done();
536-
});
537-
});
523+
runE2E();
538524
});
539525
});
540526
});

0 commit comments

Comments
 (0)