@@ -69,48 +69,83 @@ describe('index', () => {
6969
7070 test ( 'expect res setHeader and end to match snapshot' , async ( ) => {
7171 fetch . mockResponses (
72- [ JSON . stringify ( {
73- href : options . baseUrl ,
74- ocVersion : '1.2.3' ,
75- type : 'mock-registry'
76- } ) ] ,
77- [ JSON . stringify ( {
78- name : 'oc-apod' ,
79- description : 'This component displays picture, title, description and date of the NASA\'s Astronomy Picture of the Day' ,
80- version : '1.3.0' ,
81- allVersions : [ '1.0.0' , '1.1.0' , '1.1.1' , '1.2.0' , '1.3.0' ] ,
82- oc : {
83- parameters : {
84- apiKey : {
85- type : 'string' ,
86- mandatory : true ,
87- example : 'DEMO_KEY' ,
88- description : 'The NASA Open APIs key'
72+ [
73+ JSON . stringify ( {
74+ href : options . baseUrl ,
75+ ocVersion : '1.2.3' ,
76+ type : 'mock-registry'
77+ } )
78+ ] ,
79+ [
80+ JSON . stringify ( {
81+ name : 'oc-apod' ,
82+ description :
83+ "This component displays picture, title, description and date of the NASA's Astronomy Picture of the Day" ,
84+ version : '1.3.0' ,
85+ allVersions : [ '1.0.0' , '1.1.0' , '1.1.1' , '1.2.0' , '1.3.0' ] ,
86+ oc : {
87+ parameters : {
88+ apiKey : {
89+ type : 'string' ,
90+ mandatory : true ,
91+ example : 'DEMO_KEY' ,
92+ description : 'The NASA Open APIs key'
93+ }
8994 }
9095 }
91- }
92- } ) ] ,
93- [ JSON . stringify ( {
94- components : [
95- `${ options . baseUrl } oc-a-component`
96- ]
97- } ) ] ,
98- [ JSON . stringify ( {
99- name : 'oc-a-component' ,
100- description : 'Awesome OpenComponent' ,
101- version : '4.5.6' ,
102- allVersions : [ '4.5.4' , '4.5.5' , '4.5.6' ] ,
103- oc : {
104- parameters : {
105- id : {
106- type : 'string' ,
107- mandatory : true ,
108- example : '789' ,
109- description : 'The Id'
96+ } )
97+ ] ,
98+ [
99+ JSON . stringify ( {
100+ components : [
101+ `${ options . baseUrl } oc-a-component` ,
102+ `${ options . baseUrl } oc-client`
103+ ]
104+ } )
105+ ] ,
106+ [
107+ JSON . stringify ( {
108+ name : 'oc-a-component' ,
109+ description : 'Awesome OpenComponent' ,
110+ version : '4.5.6' ,
111+ allVersions : [ '4.5.4' , '4.5.5' , '4.5.6' ] ,
112+ oc : {
113+ parameters : {
114+ id : {
115+ type : 'string' ,
116+ mandatory : true ,
117+ example : '789' ,
118+ description : 'The Id'
119+ }
110120 }
111121 }
112- }
113- } ) ]
122+ } )
123+ ] ,
124+ [
125+ JSON . stringify ( {
126+ name : 'oc-client' ,
127+ description : 'The OpenComponents client-side javascript client' ,
128+ version : '0.40.7' ,
129+ allVersions : [
130+ '0.40.7' ,
131+ '0.40.1' ,
132+ '0.39.8' ,
133+ '0.38.1' ,
134+ '0.37.11' ,
135+ '0.37.8' ,
136+ '0.37.4' ,
137+ '0.37.2' ,
138+ '0.37.0' ,
139+ '0.36.27' ,
140+ '0.36.26' ,
141+ '0.36.25' ,
142+ '0.36.21' ,
143+ '0.36.13' ,
144+ '0.36.4' ,
145+ '0.36.1'
146+ ]
147+ } )
148+ ]
114149 ) ;
115150
116151 const req = {
@@ -131,4 +166,3 @@ describe('index', () => {
131166 expect ( JSON . parse ( res . end . mock . calls ) ) . toMatchSnapshot ( ) ;
132167 } ) ;
133168} ) ;
134-
0 commit comments