jeffijoe/awilix

View on GitHub
src/__tests__/fixture/services/mainService.js

Summary

Maintainability
A
0 mins
Test Coverage
module.exports = function ({ answerRepository }) {
  const getTheAnswer = function (question) {
    const repo = answerRepository
    return repo.getAnswerFor(question).then((theAnswer) => {
      return `The answer to "${question}" is: ${theAnswer}`
    })
  }

  return {
    getTheAnswer,
  }
}