File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,8 @@ import {
1111} from 'bun:test'
1212import React from 'react'
1313
14+ import type { ClientEnv } from '@codebuff/common/types/contracts/env'
15+
1416import { useChatStore } from '../../state/chat-store'
1517import * as authModule from '../../utils/auth'
1618import {
@@ -65,11 +67,12 @@ describe('fetchUsageData', () => {
6567 } )
6668
6769 test ( 'should throw error when app URL is not set' , async ( ) => {
68- delete process . env . NEXT_PUBLIC_CODEBUFF_APP_URL
69-
70- await expect ( fetchUsageData ( { authToken : 'test-token' } ) ) . rejects . toThrow (
71- 'NEXT_PUBLIC_CODEBUFF_APP_URL is not set' ,
72- )
70+ await expect (
71+ fetchUsageData ( {
72+ authToken : 'test-token' ,
73+ clientEnv : { NEXT_PUBLIC_CODEBUFF_APP_URL : undefined } as ClientEnv ,
74+ } ) ,
75+ ) . rejects . toThrow ( 'NEXT_PUBLIC_CODEBUFF_APP_URL is not set' )
7376 } )
7477} )
7578
You can’t perform that action at this time.
0 commit comments