@@ -69,48 +69,55 @@ 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 : [ `${ options . baseUrl } oc-a-component` ]
101+ } )
102+ ] ,
103+ [
104+ JSON . stringify ( {
105+ name : 'oc-a-component' ,
106+ description : 'Awesome OpenComponent' ,
107+ version : '4.5.6' ,
108+ allVersions : [ '4.5.4' , '4.5.5' , '4.5.6' ] ,
109+ oc : {
110+ parameters : {
111+ id : {
112+ type : 'string' ,
113+ mandatory : true ,
114+ example : '789' ,
115+ description : 'The Id'
116+ }
110117 }
111118 }
112- }
113- } ) ]
119+ } )
120+ ]
114121 ) ;
115122
116123 const req = {
@@ -131,4 +138,3 @@ describe('index', () => {
131138 expect ( JSON . parse ( res . end . mock . calls ) ) . toMatchSnapshot ( ) ;
132139 } ) ;
133140} ) ;
134-
0 commit comments