@@ -82,57 +82,57 @@ const mockTimetables1 = [
8282 } ,
8383] ;
8484
85- //Mock list of offering
85+ //Mock list of offering
8686const offering1 = [
8787 {
88- id :1 ,
89- course_id :101 ,
90- day :"MO" ,
91- start :"10:00:00" ,
92- end :"11:00:00" ,
88+ id : 1 ,
89+ course_id : 101 ,
90+ day : "MO" ,
91+ start : "10:00:00" ,
92+ end : "11:00:00" ,
9393 } ,
9494 {
95- id :2 ,
96- course_id :101 ,
97- day :"WE" ,
98- start :"10:00:00" ,
99- end :"11:00:00" ,
95+ id : 2 ,
96+ course_id : 101 ,
97+ day : "WE" ,
98+ start : "10:00:00" ,
99+ end : "11:00:00" ,
100100 } ,
101101 {
102- id :3 ,
103- course_id :101 ,
104- day :"FR" ,
105- start :"10:00:00" ,
106- end :"11:00:00" ,
107- }
108- ]
102+ id : 3 ,
103+ course_id : 101 ,
104+ day : "FR" ,
105+ start : "10:00:00" ,
106+ end : "11:00:00" ,
107+ } ,
108+ ] ;
109109
110110const offering2 = [
111111 {
112- id :1 ,
113- course_id :102 ,
114- day :"MO" ,
115- start :"10:00:00" ,
116- end :"12:00:00" ,
117- }
118- ]
112+ id : 1 ,
113+ course_id : 102 ,
114+ day : "MO" ,
115+ start : "10:00:00" ,
116+ end : "12:00:00" ,
117+ } ,
118+ ] ;
119119
120120const offering3 = [
121121 {
122- id :1 ,
123- course_id :103 ,
124- day :"TU" ,
125- start :"15:00:00" ,
126- end :"17:00:00" ,
122+ id : 1 ,
123+ course_id : 103 ,
124+ day : "TU" ,
125+ start : "15:00:00" ,
126+ end : "17:00:00" ,
127127 } ,
128128 {
129- id :2 ,
130- course_id :103 ,
131- day :"WE" ,
132- start :"15:00:00" ,
133- end :"17:00:00" ,
129+ id : 2 ,
130+ course_id : 103 ,
131+ day : "WE" ,
132+ start : "15:00:00" ,
133+ end : "17:00:00" ,
134134 } ,
135- ]
135+ ] ;
136136
137137// Spy on the getTimetables method
138138jest
@@ -199,28 +199,28 @@ jest.mock("../../src/db/setupDb", () => ({
199199 } ;
200200 }
201201 //DB response with offering1 if courseID = 101 in request
202- if ( key === "course_id" && value === 101 ) {
203- return {
204- eq :jest . fn ( ) . mockImplementation ( ( ) => {
205- return { data : offering1 , error : null }
206- } )
207- }
202+ if ( key === "course_id" && value === 101 ) {
203+ return {
204+ eq : jest . fn ( ) . mockImplementation ( ( ) => {
205+ return { data : offering1 , error : null } ;
206+ } ) ,
207+ } ;
208208 }
209209 //DB response with offering1 if courseID = 102 in request
210- if ( key === "course_id" && value === 102 ) {
211- return {
212- eq :jest . fn ( ) . mockImplementation ( ( ) => {
213- return { data : offering2 , error : null }
214- } )
215- }
210+ if ( key === "course_id" && value === 102 ) {
211+ return {
212+ eq : jest . fn ( ) . mockImplementation ( ( ) => {
213+ return { data : offering2 , error : null } ;
214+ } ) ,
215+ } ;
216216 }
217217 //DB response with offering1 if courseID = 103 in request
218- if ( key === "course_id" && value === 103 ) {
219- return {
220- eq :jest . fn ( ) . mockImplementation ( ( ) => {
221- return { data : offering1 , error : null }
222- } )
223- }
218+ if ( key === "course_id" && value === 103 ) {
219+ return {
220+ eq : jest . fn ( ) . mockImplementation ( ( ) => {
221+ return { data : offering1 , error : null } ;
222+ } ) ,
223+ } ;
224224 }
225225 } ) ,
226226 // Mock db response to .insert query command
@@ -276,8 +276,8 @@ describe("Simple test case for offering", () => {
276276 jest . clearAllMocks ( ) ;
277277 } ) ;
278278
279- test ( "should return offering1" , async ( ) => {
280- const response = await getOfferings ( 101 , "Spring" )
281- expect ( response ) . toEqual ( offering1 )
282- } )
283- } )
279+ test ( "should return offering1" , async ( ) => {
280+ const response = await getOfferings ( 101 , "Spring" ) ;
281+ expect ( response ) . toEqual ( offering1 ) ;
282+ } ) ;
283+ } ) ;
0 commit comments