import { test, expect, afterEach, afterAll } from 'vitest'
const rows = []
const row = (stage, value = {}) => rows.push({ stage, ...value })
afterEach(({ task }) => { row('afterEach', { errors: (task.result?.errors ?? []).map(error => error?.message ?? String(error)) }) })
afterAll(() => console.log('TASK_QUEUE_CONSUMER:' + JSON.stringify(rows)))
test('actual public queue failure skips assertion count failure', ({ task, expect: local }) => {
  local.assertions(2); local(true).toBe(true)
  const error = new Error('only manual queue failure'); error.stack = ''
  task.promises = [Promise.reject(error)]
  row('body-return', { assertions: local.getState().assertionCalls })
})
