Stryker

app.js - Stryker report

Summary

File
Mutation score
# Killed
# Survived
# Timeout
# No coverage
# Errors
Total detected
Total undetected
Total mutants
app.js
100%
29/29 23 0 6 0 0 29 0 29

Code

angular.module('juiceShop', 0[
  'ngRoute',
  'ngCookies',
  'ngTouch',
  'ngAnimate',
  'ngFileUpload',
  'ui.bootstrap',
  'pascalprecht.translate',
  'btford.socket-io',
  'ngclipboard',
  'base64',
  'monospaced.qrcode'
])

angular.module('juiceShop').factory('authInterceptor', 1['$rootScope', '$q', '$cookies', function ($rootScope, $q, $cookies) 2{
  'use strict'
  return {
    request: function (config) 3{
      config.headers = 4config.headers || {}
      if (56$cookies.get('token')) 7{
        config.headers.Authorization = 8'Bearer ' + $cookies.get('token')
      }
      return config
    },
    response: function (response) 9{
      return 10response || $q.when(response)
    }
  }
}])

angular.module('juiceShop').factory('rememberMeInterceptor', 11['$rootScope', '$q', '$cookies', function ($rootScope, $q, $cookies) 12{
  'use strict'
  return {
    request: function (config) 13{
      config.headers = 14config.headers || {}
      if (1516$cookies.get('email')) 17{
        config.headers['X-User-Email'] = $cookies.get('email')
      }
      return config
    },
    response: function (response) 18{
      return 19response || $q.when(response)
    }
  }
}])

angular.module('juiceShop').factory('socket', 20['socketFactory', function (socketFactory) 21{
  return socketFactory()
}])

angular.module('juiceShop').config(22['$httpProvider', function ($httpProvider) 23{
  'use strict'
  $httpProvider.interceptors.push('authInterceptor')
  $httpProvider.interceptors.push('rememberMeInterceptor')
}])

angular.module('juiceShop').run(24['$cookies', '$rootScope', function ($cookies, $rootScope) 25{
  'use strict'

  $rootScope.isLoggedIn = function () 26{
    return $cookies.get('token')
  }
}])

angular.module('juiceShop').config(27['$translateProvider', function ($translateProvider) 28{
  'use strict'
  $translateProvider.useStaticFilesLoader({
    prefix: '/i18n/',
    suffix: '.json'
  })
  $translateProvider.determinePreferredLanguage()
  $translateProvider.fallbackLanguage('en')
}])