javascript - Why does sinon fakeserver not reply to request from Vue component -
i chasing race condition since days now. glad help. both sinon fakeserver , vue.js related question.
here setup of my little project:
the project based on awesome vue webpack template.
i have rather elaborate vue component called doogietable shows table. can load data remote rest endpoint. (using vue-resource)
i have mocha test case doogietable. second test loading remote data table problem.
the test mocks xhhtmlrequest sinon.fakeserver , responds canned data.
this works long set fakeserver.autorespond = true;
according sinon doc, not suitable production ready unit tests.
when/where in code of test case have call fakeserver.respond()
?
things tried:
- calling right after the vue component doogietable became ready => seems to early. @ point in time, request load data has not been send component. (i think. not quite sure)
- calling in vm.$nexttick callback => same problem. no request yet.
Comments
Post a Comment