()
| 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. |
nothing calls this directly
no test coverage detected