Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8734053
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T09:46:07+00:00 2026-06-13T09:46:07+00:00

Hi I am testing a collection using fetch, when I call it there is

  • 0

Hi I am testing a collection using fetch, when I call it there is no answer from the fake server only after calling server.response I get the desired result.

Why is that ?

My code

  beforeEach( function() {
    server = sinon.fakeServer.create();
    server.autoRespond = true;
    colhedoraList = new ColhedoraList();
  });

.
.
.
    var spy       = sinon.spy(colhedoraList, 'parse');

    server.respondWith("GET", "getColhedoraInfo",
      [200, {"Content-Type": "application/json"},
      '[{"id":"1","talhaoAtual":1,"posicionamentos":[{"lat":-23.9317401,"lng":-50.2210379,"elevadorLigado":true,"horario":"2012-09-21T11:27:58Z"},{"lat":-23.931544,"lng":-50.2161884,"elevadorLigado":true,"horario":"2012-09-21T11:28:02Z"}]}]']);

    colhedoraList.fetch({add: true});
    server.respond();
    expect(spy).toHaveBeenCalled();
    expect(spygmaps).toHaveBeenCalledTwice();
    expect(colhedoraList.get(1).get('talhaoAtual')).toEqual(1);    <<< ALL EXPECTS FAIL, If I don't call respond().
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T09:46:08+00:00Added an answer on June 13, 2026 at 9:46 am

    If you are using mock timers (sinon.useFakeTimers) anywhere in the spec, that might stop the autoresponder from working. The addRequest method creates a timeout inside which the request is actually responded to. The default wait time is 10ms.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

for testing purpose I wrote a VBscript which will fetch values from Sybase by
Been trying to fetch documents from a collection, and the documents contains nested documents.
I'm using a service to generate code and i get responses back from an
I'm using a viewpager that will get image sources from a webservice, and dynamically
I'm testing a server and I need to keep alive some connection as long
In testing an app, I keep getting errors that occur sporadically on only one
I'm working on a testing application using TypeScript and BackboneJS. It's mainly an employees
I'm working on a groovy unit-testing class that contains a collection of rules for
I'm using Mockito for my unit testing, and I've run across an issue where
I am trying to get a handle on proper memory usage and garbage collection

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.