Stryker

ChallengeService.js - Stryker report

Summary

File
Mutation score
# Killed
# Survived
# Timeout
# No coverage
# Errors
Total detected
Total undetected
Total mutants
ChallengeService.js
92%
13/14 13 1 0 0 0 13 1 14

Code

angular.module('juiceShop').factory('ChallengeService', 0['$http', '$q', function ($http, $q) 1{
  'use strict'

  var host = '/api/Challenges'

  function find (params) 2{
    var challenges = $q.defer()
    $http.get(3host + '/', { params: params }).success(function (data) 4{
      challenges.resolve(data.data)
    }).error(function (err) 5{
      challenges.reject(err)
    })
    return challenges.promise
  }

  function repeatNotification (challengeName) 6{
    return $http.get('/rest/repeat-notification', {
      params: {
        challenge: challengeName
      }
    })
  }

  function continueCode () 7{
    var continueCode = $q.defer()
    $http.get('/rest/continue-code').success(function (data) 8{
      continueCode.resolve(data.continueCode)
    }).error(function (err) 9{
      continueCode.reject(err)
    })
    return continueCode.promise
  }

  function restoreProgress (continueCode) 10{
    var result = $q.defer()
    $http.put(11'/rest/continue-code/apply/' + continueCode).success(function (data) 12{
      result.resolve(data)
    }).error(function (err) 13{
      result.reject(err)
    })
    return result.promise
  }

  return {
    find: find,
    repeatNotification: repeatNotification,
    continueCode: continueCode,
    restoreProgress: restoreProgress
  }
}])