Skip to content

Refactor: remove migration code #1189

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,6 @@ var AngularFullstackGenerator = yeoman.generators.Base.extend({
jasmine: true
});

// NOTE: temp(?) fix for #403
if(typeof this.filters.oauth === 'undefined') {
var strategies = Object.keys(this.filters).filter(function(key) {
return key.match(/Auth$/) && this.filters[key];
}.bind(this));

if(strategies.length) this.filters.oauth = true;
}

this.config.set('filters', this.filters);
this.config.forceSave();

Expand Down
24 changes: 20 additions & 4 deletions test/fixtures/.yo-rc.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,36 @@
{
"generator-angular-fullstack": {
"insertRoutes": "true",
"endpointDirectory": "server/api/",
"insertRoutes": true,
"registerRoutesFile": "server/routes.js",
"routesNeedle": "// Insert routes below",
"insertSockets": "true",
"routesBase": "/api/",
"pluralizeRoutes": true,
"insertSockets": true,
"registerSocketsFile": "server/config/socketio.js",
"socketsNeedle": "// Insert sockets below",
"insertModels": true,
"registerModelsFile": "server/sqldb/index.js",
"modelsNeedle": "// Insert models below",
"filters": {
"coffee": true,
"html": true,
"less": true,
"uirouter": true,
"bootstrap": false,
"uibootstrap": false,
"socketio": true,
"mongoose": true,
"auth": true,
"googleAuth": true
"models": true,
"mongooseModels": true,
"mongoose": true,
"oauth": true,
"googleAuth": true,
"grunt": true,
"mocha": true,
"jasmine": false,
"should": true,
"expect": false
}
}
}
22 changes: 0 additions & 22 deletions test/test-file-creation.js
Original file line number Diff line number Diff line change
Expand Up @@ -467,28 +467,6 @@ describe('angular-fullstack generator', function () {
});
});

it('should add oauth option if existing config had oauth strategy selected', function(done) {
this.timeout(60000);
copySync(__dirname + '/fixtures/.yo-rc.json', __dirname + '/temp/.yo-rc.json');
var gen = helpers.createGenerator('angular-fullstack:app', [
'../../app',
'../../endpoint',
[
helpers.createDummyGenerator(),
'ng-component:app'
]
]);
gen.options['skip-install'] = true;
helpers.mockPrompt(gen, {
skipConfig: true
});
gen.run(function () {
var yoConfig = require(__dirname + '/temp/.yo-rc.json');
expect(yoConfig['generator-angular-fullstack'].filters.oauth).to.be.true;
done();
});
});

it('should generate expected files', function (done) {
gen.run(function () {
helpers.assertFile(genFiles(defaultOptions));
Expand Down