MCPcopy
hub / github.com/tilemill-project/tilemill / ping

Function ping

test/export.test.js:103–138  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

101});
102it("GET anti-meridian job to see if it succeeded", function(done) {
103 function ping() {
104 assert.response(core, {
105 url: '/api/Export/' + antiMeridianJob.id,
106 method: 'GET',
107 headers: {
108 cookie: "bones.token=" + token,
109 'content-type': "application/json"
110 }
111 }, {
112 status: 200
113 }, function(res) {
114 var data = JSON.parse(res.body);
115 if (data.status === 'processing') {
116 // Don't flood the socket or the test will fail.
117 setTimeout(ping, 1000);
118 } else if (data.status === 'error') {
119 throw new Error(data.error);
120 } else {
121 antiMeridianJob.status = "complete";
122 antiMeridianJob.progress = 1;
123 console.log(data);
124 assert.ok(data.pid);
125 assert.ok(data.created);
126 delete antiMeridianJob['bones.token'];
127 delete data.created;
128 delete data.pid;
129
130 delete data.remaining;
131 delete data.updated;
132 delete data.rate;
133
134 assert.deepEqual(antiMeridianJob, data);
135 done();
136 }
137 });
138 }
139 ping();
140});
141it('DELETE should remove anti-meridian export job', function(done) {

Callers 1

export.test.jsFile · 0.85

Calls 1

doneFunction · 0.85

Tested by

no test coverage detected