mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-13 06:43:06 +00:00
21 lines
530 B
TypeScript
21 lines
530 B
TypeScript
import config from '@/payload.config'
|
|
import { getPayload, Payload } from 'payload'
|
|
|
|
import { beforeAll, describe, expect, it } from 'vitest'
|
|
|
|
let payload: Payload
|
|
|
|
describe('API', () => {
|
|
beforeAll(async () => {
|
|
const payloadConfig = await config
|
|
payload = await getPayload({ config: payloadConfig })
|
|
})
|
|
|
|
it('fetches users', async () => {
|
|
const users = await payload.find({
|
|
collection: 'users',
|
|
})
|
|
expect(users.docs).toBeInstanceOf(Array)
|
|
expect(typeof users.totalDocs).toBe('number')
|
|
})
|
|
})
|