diff --git a/config/karma.js b/config/karma.js index d88fe04eb..bfd0dc94a 100644 --- a/config/karma.js +++ b/config/karma.js @@ -1,64 +1,66 @@ // Testacular configuration file +module.exports = function (karma) { + karma.set({ + // base path, that will be used to resolve files and exclude + basePath: '..', -// base path, that will be used to resolve files and exclude -basePath = '..'; + frameworks: ['jasmine'], -// list of files / patterns to load in the browser -files = [ - JASMINE, - JASMINE_ADAPTER, - 'lib/angular-1.1.5.js', - 'test/lib/angular-mocks-1.1.5.js', - 'test/testUtils.js', + // list of files / patterns to load in the browser + files: [ + 'lib/angular-1.1.5.js', + 'test/lib/angular-mocks-1.1.5.js', + 'test/testUtils.js', - 'src/common.js', - 'src/resolve.js', - 'src/templateFactory.js', - 'src/urlMatcherFactory.js', - 'src/urlRouter.js', - 'src/view.js', - 'src/state.js', - 'src/viewDirective.js', - 'src/stateDirectives.js', - 'src/stateFilters.js', - 'src/compat.js', + 'src/common.js', + 'src/resolve.js', + 'src/templateFactory.js', + 'src/urlMatcherFactory.js', + 'src/urlRouter.js', + 'src/view.js', + 'src/state.js', + 'src/viewDirective.js', + 'src/stateDirectives.js', + 'src/stateFilters.js', + 'src/compat.js', - 'test/*Spec.js', - // 'test/compat/matchers.js', - // 'test/compat/*Spec.js', -]; + 'test/*Spec.js', + // 'test/compat/matchers.js', + // 'test/compat/*Spec.js', + ], -// list of files to exclude -exclude = []; + // list of files to exclude + exclude: [], -// use dots reporter, as travis terminal does not support escaping sequences -// possible values: 'dots' || 'progress' -reporter = 'dots'; + // use dots reporter, as travis terminal does not support escaping sequences + // possible values: 'dots' || 'progress' + reporters: 'dots', -// these are default values, just to show available options + // these are default values, just to show available options -// web server port -port = 8080; + // web server port + port: 8080, -// enable / disable colors in the output (reporters and logs) -colors = true; + // enable / disable colors in the output (reporters and logs) + colors: true, -// level of logging -// possible values: LOG_DISABLE || LOG_ERROR || LOG_WARN || LOG_INFO || LOG_DEBUG -logLevel = LOG_DEBUG; + // level of logging + // possible values: LOG_DISABLE || LOG_ERROR || LOG_WARN || LOG_INFO || LOG_DEBUG + logLevel: karma.LOG_DEBUG, -// enable / disable watching file and executing tests whenever any file changes -autoWatch = false; + // enable / disable watching file and executing tests whenever any file changes + autoWatch: false, -// polling interval in ms (ignored on OS that support inotify) -autoWatchInterval = 0; - -// Start these browsers, currently available: -// - Chrome -// - ChromeCanary -// - Firefox -// - Opera -// - Safari -// - PhantomJS -browsers = [ 'PhantomJS' ]; + // polling interval in ms (ignored on OS that support inotify) + autoWatchInterval: 0, + // Start these browsers, currently available: + // - Chrome + // - ChromeCanary + // - Firefox + // - Opera + // - Safari + // - PhantomJS + browsers: [ 'PhantomJS' ] + }) +}; \ No newline at end of file diff --git a/package.json b/package.json index ead99ed8a..de69ed37a 100644 --- a/package.json +++ b/package.json @@ -38,24 +38,24 @@ "dependencies": {}, "devDependencies": { "grunt": "~0.4.1", - "grunt-contrib-concat": "~0.1.3", - "grunt-contrib-uglify": "~0.2.0", - "grunt-contrib-jshint": "~0.3.0", - "grunt-contrib-watch": "~0.3.1", - "grunt-contrib-connect": "~0.2.0", - "grunt-contrib-clean": "~0.4.0", - "grunt-karma": "~0.4.3", - "jsdoc": "git://github.com/jsdoc3/jsdoc.git#v3.1.1", - "shelljs": "~0.1.4", + "grunt-contrib-concat": "~0.3.0", + "grunt-contrib-uglify": "~0.2.7", + "grunt-contrib-jshint": "~0.7.1", + "grunt-contrib-watch": "~0.5.3", + "grunt-contrib-connect": "~0.5.0", + "grunt-contrib-clean": "~0.5.0", + "grunt-karma": "~0.6.2", + "jsdoc": "git://github.com/jsdoc3/jsdoc.git#v3.2.2", + "shelljs": "~0.2.6", "faithful-exec": "~0.1.0", "karma-firefox-launcher": "~0.1.0", "karma-chrome-launcher": "~0.1.0", "karma-html2js-preprocessor": "~0.1.0", - "karma-jasmine": "~0.1.0", + "karma-jasmine": "~0.1.3", "karma-requirejs": "~0.1.0", "karma-script-launcher": "~0.1.0", "karma-coffee-preprocessor": "~0.1.0", - "karma": "~0.10.1", + "karma": "~0.10.4", "karma-phantomjs-launcher": "~0.1.0", "load-grunt-tasks": "~0.2.0", "grunt-conventional-changelog": "~1.0.0" diff --git a/src/state.js b/src/state.js index ffb0a6ed1..ed9c985ef 100644 --- a/src/state.js +++ b/src/state.js @@ -1,7 +1,7 @@ $StateProvider.$inject = ['$urlRouterProvider', '$urlMatcherFactoryProvider', '$locationProvider']; function $StateProvider( $urlRouterProvider, $urlMatcherFactory, $locationProvider) { - var root, states = {}, $state, queue = {}; + var root, states = {}, $state, queue = {}, abstractKey = 'abstract'; // Builds state properties from definition passed to registerState() var stateBuilder = { @@ -178,7 +178,7 @@ function $StateProvider( $urlRouterProvider, $urlMatcherFactory, $ states[name] = state; // Register the state in the global state list and with $urlRouter if necessary. - if (!state['abstract'] && state.url) { + if (!state[abstractKey] && state.url) { $urlRouterProvider.when(state.url, ['$match', '$stateParams', function ($match, $stateParams) { if ($state.$current.navigable != state || !equalForKeys($match, $stateParams)) { $state.transitionTo(state, $match, { location: false }); @@ -318,7 +318,7 @@ function $StateProvider( $urlRouterProvider, $urlMatcherFactory, $ throw new Error("No such state '" + to + "'"); } } - if (toState['abstract']) throw new Error("Cannot transition to abstract state '" + to + "'"); + if (toState[abstractKey]) throw new Error("Cannot transition to abstract state '" + to + "'"); if (options.inherit) toParams = inheritParams($stateParams, toParams || {}, $state.$current, toState); to = toState;