@@ -51,41 +51,29 @@ describe("BuckSlipsApi", () => {
5151 it ( "creates, updates, and gets a buckslip" , async ( ) => {
5252 const buckslipsApi = new BuckslipsApi ( CONFIG_FOR_INTEGRATION ) ;
5353
54- try {
55- // Create buckslip with proper file references
56- const createdBe = await buckslipsApi . create ( createBe ) ;
57- expect ( createdBe . id ) . toBeDefined ( ) ;
58- expect ( createdBe . description ) . toEqual ( createBe . description ) ;
54+ // Create buckslip with proper file references
55+ const createdBe = await buckslipsApi . create ( createBe ) ;
56+ expect ( createdBe . id ) . toBeDefined ( ) ;
57+ expect ( createdBe . description ) . toEqual ( createBe . description ) ;
5958
60- // Get
61- const retrievedBe = await buckslipsApi . get ( createdBe . id as string ) ;
62- expect ( retrievedBe ) . toEqual (
63- expect . objectContaining ( {
64- id : createdBe . id ,
65- } )
66- ) ;
59+ // Get
60+ const retrievedBe = await buckslipsApi . get ( createdBe . id as string ) ;
61+ expect ( retrievedBe ) . toEqual (
62+ expect . objectContaining ( {
63+ id : createdBe . id ,
64+ } )
65+ ) ;
6766
68- // Update
69- const updates = new BuckslipEditable ( {
70- description : "updated buckslip" ,
71- } ) ;
72- const updatedBe = await buckslipsApi . update (
73- retrievedBe . id as string ,
74- updates
75- ) ;
76- expect ( updatedBe ) . toBeDefined ( ) ;
77- expect ( updatedBe . description ) . toEqual ( "updated buckslip" ) ;
78- } catch ( error ) {
79- // If creation fails due to API requirements, just test the API structure
80- expect ( buckslipsApi ) . toEqual (
81- expect . objectContaining ( {
82- create : expect . any ( Function ) ,
83- get : expect . any ( Function ) ,
84- update : expect . any ( Function ) ,
85- delete : expect . any ( Function ) ,
86- } )
87- ) ;
88- }
67+ // Update
68+ const updates = new BuckslipEditable ( {
69+ description : "updated buckslip" ,
70+ } ) ;
71+ const updatedBe = await buckslipsApi . update (
72+ retrievedBe . id as string ,
73+ updates
74+ ) ;
75+ expect ( updatedBe ) . toBeDefined ( ) ;
76+ expect ( updatedBe . description ) . toEqual ( "updated buckslip" ) ;
8977 } ) ;
9078 } ) ;
9179
@@ -100,20 +88,10 @@ describe("BuckSlipsApi", () => {
10088 } ) ;
10189
10290 it ( "lists buckslips" , async ( ) => {
103- try {
104- const response = await new BuckslipsApi ( CONFIG_FOR_INTEGRATION ) . List ( ) ;
105- expect ( response . data ) . toBeDefined ( ) ;
106- // Don't require data to exist, just verify the API works
107- expect ( Array . isArray ( response . data ) ) . toBeTruthy ( ) ;
108- } catch ( error ) {
109- // If listing fails due to API requirements in CI, just verify the API structure exists
110- const buckslipsApi = new BuckslipsApi ( CONFIG_FOR_INTEGRATION ) ;
111- expect ( buckslipsApi ) . toEqual (
112- expect . objectContaining ( {
113- List : expect . any ( Function ) ,
114- } )
115- ) ;
116- }
91+ const response = await new BuckslipsApi ( CONFIG_FOR_INTEGRATION ) . List ( ) ;
92+ expect ( response . data ) . toBeDefined ( ) ;
93+ // Don't require data to exist, just verify the API works
94+ expect ( Array . isArray ( response . data ) ) . toBeTruthy ( ) ;
11795 } ) ;
11896 } ) ;
11997} ) ;
0 commit comments