MCPcopy Create free account
hub / github.com/decaporg/decap-cms / teardownBitBucketTest

Function teardownBitBucketTest

cypress/plugins/bitbucket.js:321–356  ·  view source on GitHub ↗
(taskData)

Source from the content-addressed store, hash-verified

319};
320
321async function teardownBitBucketTest(taskData) {
322 if (process.env.RECORD_FIXTURES) {
323 await resetRepositories(taskData);
324
325 try {
326 const filename = getExpectationsFilename(taskData);
327
328 console.log('Persisting recorded data for test:', path.basename(filename));
329
330 const { owner, token } = await getEnvs();
331
332 const expectations = await retrieveRecordedExpectations();
333
334 const toSanitize = {
335 owner,
336 repo: taskData.repo,
337 token,
338 ownerName: taskData.user.name,
339 };
340 // transform the mock proxy recorded requests into Cypress route format
341 const toPersist = expectations.map(expectation =>
342 transformRecordedData(expectation, toSanitize),
343 );
344
345 const toPersistString = sanitizeString(JSON.stringify(toPersist, null, 2), toSanitize);
346
347 await fs.writeFile(filename, toPersistString);
348 } catch (e) {
349 console.log(e);
350 }
351
352 await resetMockServerState();
353 }
354
355 return null;
356}
357
358module.exports = {
359 setupBitBucket,

Callers 1

teardownBackendTestFunction · 0.85

Calls 8

getExpectationsFilenameFunction · 0.85
resetMockServerStateFunction · 0.85
mapMethod · 0.80
resetRepositoriesFunction · 0.70
getEnvsFunction · 0.70
transformRecordedDataFunction · 0.70
sanitizeStringFunction · 0.70

Tested by

no test coverage detected