diff --git a/app/templates/_bower.json b/app/templates/_bower.json index c1a457f1..94cafb50 100644 --- a/app/templates/_bower.json +++ b/app/templates/_bower.json @@ -2,9 +2,26 @@ "name": "<%= name %>", "private": true, "dependencies": {<% if (includeBootstrap) { if (includeSass) { %> - "bootstrap-sass": "3.3.4"<% } else { %> - "bootstrap": "3.3.4"<% }} else if (includeJQuery) { %> + "bootstrap-sass": "~3.3.1"<% } else { %> + "bootstrap": "~3.3.1"<% }} else if (includeJQuery) { %> "jquery": "~2.1.1"<% } if (includeModernizr) { %>, "modernizr": "~2.8.1" <% } %> - } + }<% if (includeBootstrap) { %>, + "overrides": {<% if (includeSass) { %> + "bootstrap-sass": { + "main": [ + "assets/stylesheets/_bootstrap.scss", + "assets/fonts/bootstrap/*", + "assets/javascripts/bootstrap.js" + ] + } <% } else { %> + "bootstrap": { + "main": [ + "less/bootstrap.less", + "dist/css/bootstrap.css", + "dist/js/bootstrap.js", + "dist/fonts/*" + ] + } <% } %> + } <% } %> } diff --git a/test/bootstrap.js b/test/bootstrap.js index 9a1e8be4..f90cd2ce 100644 --- a/test/bootstrap.js +++ b/test/bootstrap.js @@ -65,6 +65,16 @@ describe('Bootstrap feature', function () { it('should contain the font icon path variable', function () { assert.fileContent('app/styles/main.scss', '$icon-font-path'); }); + + it('should correctly override bootstrap\'s bower.json', function() { + assert.fileContent('bower.json', '"overrides"'); + + assert.fileContent('bower.json', 'assets/stylesheets/_bootstrap.scss'); + + assert.fileContent('bower.json', 'assets/fonts/bootstrap/*'); + + assert.fileContent('bower.json', 'assets/javascripts/bootstrap.js'); + }); }); describe('without Sass', function () { @@ -85,5 +95,17 @@ describe('Bootstrap feature', function () { it('should output the correct