fix: use API key auth for test factories
Session auth requires valid better-auth sessions which can't be created programmatically. Switch factories to use API key auth which is properly supported.
This commit is contained in:
parent
b6d507fcf5
commit
d524d2ca16
1 changed files with 6 additions and 5 deletions
|
|
@ -88,10 +88,10 @@ export function getTestContext(): IntegrationTestContext {
|
|||
// Create tracker
|
||||
const tracker = new TestDataTracker();
|
||||
|
||||
// Create factories
|
||||
// Create factories (use API key client since session auth requires better-auth sessions)
|
||||
const factories = {
|
||||
agent: createAgentFactory(api, tracker),
|
||||
collection: createCollectionFactory(api, tracker),
|
||||
agent: createAgentFactory(apiKeyClient, tracker),
|
||||
collection: createCollectionFactory(apiKeyClient, tracker),
|
||||
};
|
||||
|
||||
cachedContext = {
|
||||
|
|
@ -143,9 +143,10 @@ export function createFreshTestContext(): IntegrationTestContext {
|
|||
|
||||
const tracker = new TestDataTracker();
|
||||
|
||||
// Use API key client for factories since session auth requires better-auth sessions
|
||||
const factories = {
|
||||
agent: createAgentFactory(api, tracker),
|
||||
collection: createCollectionFactory(api, tracker),
|
||||
agent: createAgentFactory(apiKeyClient, tracker),
|
||||
collection: createCollectionFactory(apiKeyClient, tracker),
|
||||
};
|
||||
|
||||
return {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue