Skip to content

Commit b3d8160

Browse files
committed
fix lint
1 parent c08b1e7 commit b3d8160

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

packages/evlog/src/better-auth/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ export interface AuthMiddlewareOptions extends IdentifyOptions {
103103
/**
104104
* Options for `createAuthIdentifier`.
105105
*/
106-
export interface AuthIdentifierOptions extends AuthMiddlewareOptions {}
106+
export type AuthIdentifierOptions = AuthMiddlewareOptions
107107

108108
const DEFAULT_USER_FIELDS = ['id', 'name', 'email', 'image', 'emailVerified', 'createdAt']
109109

packages/evlog/test/better-auth/better-auth.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ function createMockSession(overrides?: {
5252
function createMockAuth(session: ReturnType<typeof createMockSession> | null = createMockSession()) {
5353
return {
5454
api: {
55-
getSession: vi.fn(async () => session),
55+
getSession: vi.fn(() => Promise.resolve(session)),
5656
},
5757
}
5858
}
@@ -83,7 +83,7 @@ describe('identifyUser', () => {
8383
identifyUser(log, session)
8484

8585
expect(log.set).toHaveBeenCalledOnce()
86-
const call = log.setCalls[0]
86+
const [call] = log.setCalls
8787

8888
expect(call.userId).toBe('usr_123')
8989

@@ -201,7 +201,7 @@ describe('identifyUser', () => {
201201
}),
202202
})
203203

204-
const call = log.setCalls[0]
204+
const [call] = log.setCalls
205205
expect(call.organization).toBe('org_42')
206206
expect(call.role).toBe('admin')
207207
expect(call.userId).toBe('usr_123')
@@ -274,7 +274,7 @@ describe('createAuthMiddleware', () => {
274274
const log = createMockLogger()
275275
const auth = {
276276
api: {
277-
getSession: vi.fn(async () => { throw new Error('DB connection failed') }),
277+
getSession: vi.fn(() => Promise.reject(new Error('DB connection failed'))),
278278
},
279279
}
280280
const identify = createAuthMiddleware(auth)
@@ -444,7 +444,7 @@ describe('createAuthIdentifier', () => {
444444
const log = createMockLogger()
445445
const auth = {
446446
api: {
447-
getSession: vi.fn(async () => { throw new Error('DB error') }),
447+
getSession: vi.fn(() => Promise.reject(new Error('DB error'))),
448448
},
449449
}
450450
const hook = createAuthIdentifier(auth)

0 commit comments

Comments
 (0)