test(cypress-github-backend): optionally record tests and run using recorded data (#2776)

This commit is contained in:
Erez Rokah
2019-10-22 19:59:13 +03:00
committed by Shawn Erquhart
parent 0f60a559c1
commit b869ce05ae
59 changed files with 57725 additions and 146 deletions

View File

@ -147,7 +147,7 @@ export default class API {
}
checkMetadataRef() {
return this.request(`${this.repoURL}/git/refs/meta/_netlify_cms?${Date.now()}`, {
return this.request(`${this.repoURL}/git/refs/meta/_netlify_cms`, {
cache: 'no-store',
})
.then(response => response.object)

View File

@ -210,7 +210,7 @@ export default class GitHub {
logout() {
this.token = null;
if (typeof this.api.reset === 'function') {
if (this.api && typeof this.api.reset === 'function') {
return this.api.reset();
}
return;
@ -422,7 +422,11 @@ export default class GitHub {
}
deleteUnpublishedEntry(collection, slug) {
return this.api.deleteUnpublishedEntry(collection, slug);
// deleteUnpublishedEntry is a transactional operation
return this.runWithLock(
() => this.api.deleteUnpublishedEntry(collection, slug),
'Failed to acquire delete entry lock',
);
}
publishUnpublishedEntry(collection, slug) {