MCPcopy Index your code
hub / github.com/codeceptjs/CodeceptJS / _after

Method _after

lib/helper/GraphQLDataFactory.js:186–201  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

184 }
185
186 _after() {
187 if (!this.config.cleanup) {
188 return Promise.resolve()
189 }
190 const promises = []
191 // clean up all created items
192 for (const mutationName in this.created) {
193 const createdItems = this.created[mutationName]
194 if (!createdItems.length) continue
195 this.debug(`Deleting ${createdItems.length} ${mutationName}(s)`)
196 for (const itemData of createdItems) {
197 promises.push(this._requestDelete(mutationName, itemData))
198 }
199 }
200 return Promise.all(promises)
201 }
202
203 /**
204 * Generates a new record using factory, sends a GraphQL mutation to store it.

Callers

nothing calls this directly

Calls 3

_requestDeleteMethod · 0.95
debugMethod · 0.80
pushMethod · 0.80

Tested by

no test coverage detected