Skip to content

Commit

Permalink
implement acceptance tests for subgenerator for aurelia, #175
Browse files Browse the repository at this point in the history
  • Loading branch information
ericmdantas committed Jul 29, 2016
1 parent 411847e commit af401b1
Show file tree
Hide file tree
Showing 7 changed files with 401 additions and 3 deletions.
57 changes: 57 additions & 0 deletions test/acceptance/test-component.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,61 @@ describe('subgenerator -> component', () => {
});
});
})

describe('aurelia1', () => {
describe('testsSeparated is true', () => {
before(function (done) {
helpers
.run(path.join(__dirname, '../../component'))
.inTmpDir(function(dir) {
MockConfigFile.create({
"generator-ng-fullstack": {
"client": "aurelia1",
"testsSeparated": true
}
}, this.async());
})
.withArguments('user')
.withOptions({ 'skip-install': true, feature: 'yo'})
.on('end', done);
});

it('creates files', () => {
assert.file([
'client/dev/yo/components/user.js',
'client/dev/yo/components/user.html',
'client/dev/yo/styles/user.css',
'tests/client/yo/components/user_test.js'
]);
});
});

describe('testsSeparated is false', () => {
before(function (done) {
helpers
.run(path.join(__dirname, '../../component'))
.inTmpDir(function(dir) {
MockConfigFile.create({
"generator-ng-fullstack": {
"client": "aurelia1",
"testsSeparated": false
}
}, this.async());
})
.withArguments('user')
.withOptions({ 'skip-install': true, feature: 'yo'})
.on('end', done);
});

it('creates files', () => {
assert.file([
'client/dev/yo/components/user.js',
'client/dev/yo/components/user.html',
'client/dev/yo/styles/user.css',
'client/dev/yo/components/user_test.js'
]);
});
});
})

})
61 changes: 60 additions & 1 deletion test/acceptance/test-directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,65 @@ describe('subgenerator -> directive', () => {
]);
});
});
})
})

describe('aurelia1', () => {
describe('testsSeparated is true', () => {
before(function (done) {
helpers
.run(path.join(__dirname, '../../directive'))
.inTmpDir(function(dir) {
MockConfigFile.create({
"generator-ng-fullstack": {
"client": "aurelia1",
"testsSeparated": true
}
}, this.async());
})
.withArguments('something')
.withOptions({ 'skip-install': true, feature: 'common'})
.on('end', done);
});

after((done) => {
MockConfigFile.delete(done);
});

it('creates files', () => {
assert.file([
'client/dev/common/directives/something.js',
'tests/client/common/directives/something_test.js'
]);
});
});

describe('testsSeparated is false', () => {
before(function (done) {
helpers
.run(path.join(__dirname, '../../directive'))
.inTmpDir(function(dir) {
MockConfigFile.create({
"generator-ng-fullstack": {
"client": "aurelia1",
"testsSeparated": false
}
}, this.async());
})
.withArguments('something')
.withOptions({ 'skip-install': true, feature: 'common'})
.on('end', done);
});

after((done) => {
MockConfigFile.delete(done);
});

it('creates files', () => {
assert.file([
'client/dev/common/directives/something.js',
'client/dev/common/directives/something_test.js'
]);
});
});
})
});
52 changes: 52 additions & 0 deletions test/acceptance/test-factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,4 +159,56 @@ describe('subgenerator -> factory', () => {
});
});
})

describe('aurelia1', () => {
describe('testsSeparated is true', () => {
before((done) => {
helpers
.run(path.join(__dirname, '../../factory'))
.inTmpDir(function(dir) {
MockConfigFile.create({
"generator-ng-fullstack": {
"client": "aurelia1",
"testsSeparated": true
}
}, this.async());
})
.withArguments('cars')
.withOptions({ 'skip-install': true, feature: 'myModel'})
.on('end', done);
});

it('creates files', () => {
assert.file([
'client/dev/myModel/factory/cars.js',
'tests/client/myModel/factory/cars_test.js'
]);
});
});

describe('testsSeparated is false', () => {
before((done) => {
helpers
.run(path.join(__dirname, '../../factory'))
.inTmpDir(function(dir) {
MockConfigFile.create({
"generator-ng-fullstack": {
"client": "aurelia1",
"testsSeparated": false
}
}, this.async());
})
.withArguments('cars')
.withOptions({ 'skip-install': true, feature: 'myModel'})
.on('end', done);
});

it('creates files', () => {
assert.file([
'client/dev/myModel/factory/cars.js',
'client/dev/myModel/factory/cars_test.js'
]);
});
});
})
});
52 changes: 52 additions & 0 deletions test/acceptance/test-filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,56 @@ describe('subgenerator -> filter', () => {
})
})

describe('aurelia1', () => {
describe('testsSeparated is true', () => {
before(function (done) {
helpers
.run(path.join(__dirname, '../../filter'))
.inTmpDir(function(dir) {
MockConfigFile.create({
"generator-ng-fullstack": {
"client": "aurelia1",
"testsSeparated": true
}
}, this.async());
})
.withArguments('something')
.withOptions({ 'skip-install': true, feature: 'beautifiers'})
.on('end', done);
});

it('creates files', () => {
assert.file([
'client/dev/beautifiers/filters/something.js',
'tests/client/beautifiers/filters/something_test.js'
]);
});
})

describe('testsSeparated is false', () => {
before(function (done) {
helpers
.run(path.join(__dirname, '../../filter'))
.inTmpDir(function(dir) {
MockConfigFile.create({
"generator-ng-fullstack": {
"client": "aurelia1",
"testsSeparated": false
}
}, this.async());
})
.withArguments('something')
.withOptions({ 'skip-install': true, feature: 'beautifiers'})
.on('end', done);
});

it('creates files', () => {
assert.file([
'client/dev/beautifiers/filters/something.js',
'client/dev/beautifiers/filters/something_test.js'
]);
});
})
})

});
54 changes: 53 additions & 1 deletion test/acceptance/test-model.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ describe('subgenerator -> model', () => {
});
});

describe('ng2 - testsSeparated is false', () => {
describe('testsSeparated is false', () => {
before((done) => {
helpers
.run(path.join(__dirname, '../../model'))
Expand All @@ -160,4 +160,56 @@ describe('subgenerator -> model', () => {
});
})

describe('aurelia1', () => {
describe('testsSeparated is true', () => {
before((done) => {
helpers
.run(path.join(__dirname, '../../model'))
.inTmpDir(function(dir) {
MockConfigFile.create({
"generator-ng-fullstack": {
"client": "aurelia1",
"testsSeparated": true
}
}, this.async());
})
.withArguments('cars')
.withOptions({ 'skip-install': true, feature: 'myModel'})
.on('end', done);
});

it('creates files', () => {
assert.file([
'client/dev/myModel/models/cars.js',
'tests/client/myModel/models/cars_test.js'
]);
});
});

describe('testsSeparated is false', () => {
before((done) => {
helpers
.run(path.join(__dirname, '../../model'))
.inTmpDir(function(dir) {
MockConfigFile.create({
"generator-ng-fullstack": {
"client": "aurelia1",
"testsSeparated": false
}
}, this.async());
})
.withArguments('cars')
.withOptions({ 'skip-install': true, feature: 'myModel'})
.on('end', done);
});

it('creates files', () => {
assert.file([
'client/dev/myModel/models/cars.js',
'client/dev/myModel/models/cars_test.js'
]);
});
});
})

});
68 changes: 68 additions & 0 deletions test/acceptance/test-module.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,4 +212,72 @@ describe('subgenerator -> module', () => {
});
});
})

describe('aurelia1', () => {
describe('testsSeparated is true', () => {
before((done) => {
helpers
.run(path.join(__dirname, '../../module'))
.inTmpDir(function(dir) {
MockConfigFile.create({
"generator-ng-fullstack": {
"client": "aurelia1",
"testsSeparated": true
}
}, this.async());
})
.withArguments('cars')
.withOptions({ 'skip-install': true, feature: 'myModel'})
.on('end', done);
});

it('creates files', () => {
assert.file([
'client/dev/myModel/components/cars.js',
'client/dev/myModel/models/cars.js',
'client/dev/myModel/factory/cars.js',
'client/dev/myModel/services/cars.js',
'client/dev/myModel/styles/cars.css',

'tests/client/myModel/components/cars_test.js',
'tests/client/myModel/models/cars_test.js',
'tests/client/myModel/services/cars_test.js',
'tests/client/myModel/factory/cars_test.js'
]);
});
});

describe('testsSeparated is false', () => {
before((done) => {
helpers
.run(path.join(__dirname, '../../module'))
.inTmpDir(function(dir) {
MockConfigFile.create({
"generator-ng-fullstack": {
"client": "aurelia1",
"testsSeparated": false
}
}, this.async());
})
.withArguments('cars')
.withOptions({ 'skip-install': true, feature: 'myModel'})
.on('end', done);
});

it('creates files', () => {
assert.file([
'client/dev/myModel/components/cars.js',
'client/dev/myModel/models/cars.js',
'client/dev/myModel/factory/cars.js',
'client/dev/myModel/services/cars.js',
'client/dev/myModel/styles/cars.css',

'client/dev/myModel/components/cars_test.js',
'client/dev/myModel/models/cars_test.js',
'client/dev/myModel/services/cars_test.js',
'client/dev/myModel/factory/cars_test.js'
]);
});
});
})
});
Loading

0 comments on commit af401b1

Please sign in to comment.