Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- `
- this.server = sinon.fakeServer.create();
- this.server.autoRespond = true;
- sinon.FakeXMLHttpRequest.useFilters = true;
- sinon.FakeXMLHttpRequest.addFilter(function (method, url, async, username, password) {
- // Don't fake json file read requests
- if (url == inputUrl) {
- return true;
- }
- });
- this.resultfile = this.readJsonFile(inputUrl);
- this.server.respondWith("GET", endUrl,
- [200, { "Content-Type": "application/json" }, this.resultfile]);
- console.log (this.server.requests); // Logs all requests so far`
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement