diff --git a/generated/browser/js/app.js b/generated/browser/js/app.js index a5de5cb..37e00ad 100644 --- a/generated/browser/js/app.js +++ b/generated/browser/js/app.js @@ -1,16 +1,18 @@ 'use strict'; window.app = angular.module('FullstackGeneratedApp', ['fsaPreBuilt', 'ui.router', 'ui.bootstrap', 'ngAnimate']); -app.config(function ($urlRouterProvider, $locationProvider) { - // This turns off hashbang urls (/#about) and changes it to something normal (/about) - $locationProvider.html5Mode(true); - // If we go to a URL that ui-router doesn't have registered, go to the "/" url. - $urlRouterProvider.otherwise('/'); - // Trigger page refresh when accessing an OAuth route - $urlRouterProvider.when('/auth/:provider', function () { - window.location.reload(); +if (!window.KARMA_TESTING) { + app.config(function ($urlRouterProvider, $locationProvider) { + // This turns off hashbang urls (/#about) and changes it to something normal (/about) + $locationProvider.html5Mode(true); + // If we go to a URL that ui-router doesn't have registered, go to the "/" url. + $urlRouterProvider.otherwise('/'); + // Trigger page refresh when accessing an OAuth route + $urlRouterProvider.when('/auth/:provider', function () { + window.location.reload(); + }); }); -}); +} // This app.run is for listening to errors broadcasted by ui-router, usually originating from resolves app.run(function ($rootScope) { diff --git a/generated/package.json b/generated/package.json index 2aaccfa..0898579 100644 --- a/generated/package.json +++ b/generated/package.json @@ -69,5 +69,10 @@ "socket.io": "^1.3.4", "socket.io-client": "^1.3.5", "supertest": "^0.15.0" + }, + "license": "MIT", + "repository": { + "type": "git", + "url": "https://github.com/fullstackacademy/fsg.git" } } diff --git a/generated/tests/browser/globals.js b/generated/tests/browser/globals.js new file mode 100644 index 0000000..fbc564c --- /dev/null +++ b/generated/tests/browser/globals.js @@ -0,0 +1,4 @@ +// global variables defined here will be accessible in your browser code, +// but only while testing. + +window.KARMA_TESTING = true; diff --git a/generated/tests/browser/karma.conf.js b/generated/tests/browser/karma.conf.js index 107785a..c22f11e 100644 --- a/generated/tests/browser/karma.conf.js +++ b/generated/tests/browser/karma.conf.js @@ -11,6 +11,7 @@ module.exports = function (config) { 'node_modules/angular-ui-bootstrap/ui-bootstrap.js', 'node_modules/angular-ui-bootstrap/ui-bootstrap-tpls.js', 'node_modules/socket.io-client/socket.io.js', + 'tests/browser/globals.js', 'public/main.js', 'node_modules/sinon/pkg/sinon.js', 'node_modules/angular-mocks/angular-mocks.js',