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

Function editGet

tests/testFileEditor.js:607–628  ·  view source on GitHub ↗
(url, expectedToFindResults, expectedToFindChoice, expectedDraftContents, expectedDiskContents)

Source from the content-addressed store, hash-verified

605}
606
607function editGet(url, expectedToFindResults, expectedToFindChoice, expectedDraftContents, expectedDiskContents) {
608 describe(`GET to edit url`, function() {
609 it('should load successfully', function(callback) {
610 locals.preStartTime = Date.now();
611 request(url, function (error, response, body) {
612 if (error) {
613 return callback(error);
614 }
615 locals.postStartTime = Date.now();
616 if (response.statusCode != 200) {
617 return callback(new Error('bad status: ' + response.statusCode));
618 }
619 page = body;
620 callback(null);
621 });
622 });
623 it('should parse', function() {
624 locals.$ = cheerio.load(page);
625 });
626 verifyEdit(expectedToFindResults, expectedToFindChoice, expectedDraftContents, expectedDiskContents);
627 });
628}
629
630function doEdits(data) {
631 describe(`edit ${data.path}`, function() {

Callers 1

doEditsFunction · 0.85

Calls 3

itFunction · 0.85
callbackFunction · 0.85
verifyEditFunction · 0.85

Tested by

no test coverage detected