For ember acceptance tests is it best practice to mock services? This seems strange to me as I would expect an acceptance test not to have to mock anything as it's testing an entire system. Also, some features may call several different services.

Can someone help me out with the best approach? Trying to test my application but receive errors when the service is called.

  • 1
    What do you mean by "best?" – Robert Harvey Mar 2 '17 at 22:32
  • Hi Robert. Perhaps standard practice would have been a better term. Like I said it seems strange to have to mock anything for an acceptance test. – user1523236 Mar 2 '17 at 23:27
  • Well, yes. By definition, an acceptance test would not include mocks, because you would be testing the actual system, not a system of fake objects. – Robert Harvey Mar 3 '17 at 0:57
  • Yes, that would be my understanding of an acceptance tests too. However my tests fail when I interact with something that causes a service to be called, i.e clicking a button. From digging around it seems people(some at least) do mock services in acceptance tests, hence my question. – user1523236 Mar 3 '17 at 15:23
  • Well, what problem are you trying to solve then? Your test isn't failing because it's non-standard, or because you misunderstand the purpose of mocks; it's failing because it's a broken test. – Robert Harvey Mar 3 '17 at 17:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.