MCPcopy Create free account
hub / github.com/PrairieLearn/PrairieLearn / badGet

Function badGet

tests/testFileEditor.js:272–288  ·  view source on GitHub ↗
(url)

Source from the content-addressed store, hash-verified

270});
271
272function badGet(url) {
273 describe(`GET to edit url with bad path`, function() {
274 it('should not load successfully', function(callback) {
275 locals.preStartTime = Date.now();
276 request(url, function (error, response) {
277 if (error) {
278 return callback(error);
279 }
280 locals.postStartTime = Date.now();
281 if (response.statusCode != 400) {
282 return callback(new Error('bad status: ' + response.statusCode));
283 }
284 callback(null);
285 });
286 });
287 });
288}
289
290function badPost(action, fileEditContents, url) {
291 describe(`POST to edit url with action ${action} and with bad path`, function() {

Callers 1

testFileEditor.jsFile · 0.85

Calls 2

itFunction · 0.85
callbackFunction · 0.85

Tested by

no test coverage detected