chore: files for running tests

This commit is contained in:
Jarrod Flesch
2024-01-30 14:54:47 -05:00
parent b531f6ab8b
commit e96c7bf987
4 changed files with 7 additions and 11 deletions

View File

@@ -286,7 +286,7 @@ export const upsertRow = async <T extends TypeWithID>({
message: req.t('error:valueMustBeUnique'), message: req.t('error:valueMustBeUnique'),
}, },
], ],
req?.t ?? i18nInit(req.payload.config.i18n).t, req.t,
) )
: error : error
} }

View File

@@ -38,8 +38,6 @@ export const APIKeyAuthentication =
collection: collectionConfig.slug, collection: collectionConfig.slug,
depth: collectionConfig.auth.depth, depth: collectionConfig.auth.depth,
overrideAccess: true, overrideAccess: true,
// TODO(JAMES)(REVIEW): had to remove with new pattern
// req,
where, where,
}) })

View File

@@ -1,13 +1,9 @@
import payload from '..' import loadConfig from '../config/load'
export const build = async (): Promise<void> => { export const build = async (): Promise<void> => {
await payload.init({ const config = await loadConfig() // Will throw its own error if it fails
disableDBConnect: true,
disableOnInit: true,
local: true,
})
await payload.config.admin.bundler.build(payload.config) await config.admin.bundler.build(config)
} }
// when build.js is launched directly // when build.js is launched directly

View File

@@ -1,9 +1,11 @@
'use client'
import React, { useEffect, useState } from 'react' import React, { useEffect, useState } from 'react'
import type { User } from '../../packages/payload/src/auth' import type { User } from '../../packages/payload/src/auth'
import type { UIField } from '../../packages/payload/src/fields/config/types' import type { UIField } from '../../packages/payload/src/fields/config/types'
import { useAuth } from '../../packages/payload/src/admin/components/utilities/Auth' import { useAuth } from '../../packages/ui'
export const AuthDebug: React.FC<UIField> = () => { export const AuthDebug: React.FC<UIField> = () => {
const [state, setState] = useState<User | null | undefined>() const [state, setState] = useState<User | null | undefined>()