test(cypress-github-backend): optionally record tests and run using recorded data (#2776)
This commit is contained in:
committed by
Shawn Erquhart
parent
0f60a559c1
commit
b869ce05ae
@ -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)
|
||||
|
@ -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) {
|
||||
|
Reference in New Issue
Block a user