@@ -4,7 +4,6 @@ import { describe, expect, it } from 'bun:test'
44import { CodebuffClient } from '@codebuff/sdk'
55import filePickerDefinition from '../file-explorer/file-picker'
66import fileListerDefinition from '../file-explorer/file-lister'
7-
87import type { PrintModeEvent } from '@codebuff/common/types/print-mode'
98
109/**
@@ -22,10 +21,7 @@ describe('File Lister Agent Integration - read_subtree tool', () => {
2221 it (
2322 'should find relevant files using read_subtree tool' ,
2423 async ( ) => {
25- const apiKey = process . env [ API_KEY_ENV_VAR ]
26- if ( ! apiKey ) {
27- throw new Error ( 'API key not found' )
28- }
24+ const apiKey = process . env [ API_KEY_ENV_VAR ] !
2925
3026 // Create mock project files that the file-lister should be able to find
3127 const projectFiles : Record < string , string > = {
@@ -142,10 +138,7 @@ export interface User {
142138 it (
143139 'should use the file tree from session state' ,
144140 async ( ) => {
145- const apiKey = process . env [ API_KEY_ENV_VAR ]
146- if ( ! apiKey ) {
147- throw new Error ( 'API key not found' )
148- }
141+ const apiKey = process . env [ API_KEY_ENV_VAR ] !
149142
150143 // Create a different set of project files with a specific structure
151144 const projectFiles : Record < string , string > = {
@@ -196,10 +189,7 @@ export interface User {
196189 it (
197190 'should respect directories parameter' ,
198191 async ( ) => {
199- const apiKey = process . env [ API_KEY_ENV_VAR ]
200- if ( ! apiKey ) {
201- throw new Error ( 'API key not found' )
202- }
192+ const apiKey = process . env [ API_KEY_ENV_VAR ] !
203193
204194 // Create project with multiple top-level directories
205195 const projectFiles : Record < string , string > = {
@@ -261,10 +251,7 @@ describe('File Picker Agent Integration - spawn_agents tool', () => {
261251 it . skip (
262252 'should spawn file-lister subagent and find relevant files' ,
263253 async ( ) => {
264- const apiKey = process . env [ API_KEY_ENV_VAR ]
265- if ( ! apiKey ) {
266- throw new Error ( 'API key not found' )
267- }
254+ const apiKey = process . env [ API_KEY_ENV_VAR ] !
268255
269256 // Create mock project files
270257 const projectFiles : Record < string , string > = {
0 commit comments