File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -162,20 +162,22 @@ describe('Tools', () => {
162162 expect ( result . content ) . toHaveLength ( 1 ) ;
163163 expect ( result . content [ 0 ] . type ) . toBe ( 'text' ) ;
164164
165- const envJson = JSON . parse ( result . content [ 0 ] . text ) ;
166- expect ( envJson . TEST_VAR_EVERYTHING ) . toBe ( 'test_value' ) ;
165+ const text = result . content [ 0 ] . text ;
166+ expect ( text ) . toBe ( 'TEST_VAR_EVERYTHING= test_value' ) ;
167167
168168 delete process . env . TEST_VAR_EVERYTHING ;
169169 } ) ;
170170
171- it ( 'should return valid JSON ' , async ( ) => {
171+ it ( 'should return valid output ' , async ( ) => {
172172 const { mockServer, handlers } = createMockServer ( ) ;
173173 registerGetEnvTool ( mockServer ) ;
174174
175175 const handler = handlers . get ( 'get-env' ) ! ;
176176 const result = await handler ( { key : 'PATH' } ) ;
177177
178- expect ( ( ) => JSON . parse ( result . content [ 0 ] . text ) ) . not . toThrow ( ) ;
178+ expect ( result . content ) . toHaveLength ( 1 ) ;
179+ expect ( result . content [ 0 ] . type ) . toBe ( 'text' ) ;
180+ expect ( result . content [ 0 ] . text ) . toMatch ( / ^ P A T H = / ) ;
179181 } ) ;
180182 } ) ;
181183
You can’t perform that action at this time.
0 commit comments