Skip to content

Commit 7da7585

Browse files
committed
all empty
1 parent d6c67cb commit 7da7585

File tree

6 files changed

+146
-401
lines changed

6 files changed

+146
-401
lines changed

__tests__/__snapshots__/index.test.js.snap

Lines changed: 12 additions & 292 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Array [
88
],
99
Array [
1010
"Content-Length",
11-
"5100",
11+
"252",
1212
],
1313
]
1414
`;
@@ -17,304 +17,24 @@ exports[`expect res setHeader and end to match snapshot 2`] = `
1717
Object {
1818
"data": Object {
1919
"component": Object {
20-
"allVersions": Array [
21-
"1.3.0",
22-
"1.2.0",
23-
"1.1.1",
24-
"1.1.0",
25-
"1.0.0",
26-
],
27-
"author": Object {
28-
"email": "[email protected]",
29-
"name": "Mattia Richetto",
30-
},
31-
"description": "This component displays picture, title, description and date of the NASA's Astronomy Picture of the Day",
32-
"name": "oc-apod",
33-
"parameters": Array [
34-
Object {
35-
"description": "The NASA Open APIs key",
36-
"example": "DEMO_KEY",
37-
"key": "apiKey",
38-
"mandatory": true,
39-
"type": "string",
40-
},
41-
],
42-
"repository": Object {
43-
"type": "git",
44-
"url": "https://github.com/mattiaerre/oc-hub/tree/master/oc-apod",
45-
},
46-
"version": "1.3.0",
20+
"allVersions": null,
21+
"author": null,
22+
"description": null,
23+
"name": null,
24+
"parameters": Array [],
25+
"repository": null,
26+
"version": null,
4727
},
48-
"components": Array [
49-
Object {
50-
"allVersions": Array [
51-
"1.3.0",
52-
"1.2.0",
53-
"1.1.1",
54-
"1.1.0",
55-
"1.0.0",
56-
],
57-
"author": Object {
58-
"email": "[email protected]",
59-
"name": "Mattia Richetto",
60-
},
61-
"description": "This component displays picture, title, description and date of the NASA's Astronomy Picture of the Day",
62-
"name": "oc-apod",
63-
"parameters": Array [
64-
Object {
65-
"description": "The NASA Open APIs key",
66-
"example": "DEMO_KEY",
67-
"key": "apiKey",
68-
"mandatory": true,
69-
"type": "string",
70-
},
71-
],
72-
"repository": Object {
73-
"type": "git",
74-
"url": "https://github.com/mattiaerre/oc-hub/tree/master/oc-apod",
75-
},
76-
"version": "1.3.0",
77-
},
78-
Object {
79-
"allVersions": Array [
80-
"0.37.4",
81-
"0.37.2",
82-
"0.37.0",
83-
"0.36.27",
84-
"0.36.26",
85-
"0.36.25",
86-
"0.36.21",
87-
"0.36.13",
88-
"0.36.4",
89-
"0.36.1",
90-
],
91-
"author": Object {
92-
"email": null,
93-
"name": null,
94-
},
95-
"description": "The OpenComponents client-side javascript client",
96-
"name": "oc-client",
97-
"parameters": Array [],
98-
"repository": Object {
99-
"type": null,
100-
"url": null,
101-
},
102-
"version": "0.37.4",
103-
},
104-
Object {
105-
"allVersions": Array [
106-
"1.1.0",
107-
"1.0.1",
108-
"1.0.0",
109-
],
110-
"author": Object {
111-
"email": "[email protected]",
112-
"name": "Mattia Richetto",
113-
},
114-
"description": "A header for a website with logo and title",
115-
"name": "oc-columbus-header",
116-
"parameters": Array [
117-
Object {
118-
"description": "The main title",
119-
"example": "Instagram",
120-
"key": "title",
121-
"mandatory": true,
122-
"type": "string",
123-
},
124-
Object {
125-
"description": "The logo's absolute url",
126-
"example": "http://www.uidownload.com/files/722/15/621/facebook-instagram-instagram-2016-instagram-logo-new-new-instagram-icon.png",
127-
"key": "logoUrl",
128-
"mandatory": true,
129-
"type": "string",
130-
},
131-
],
132-
"repository": Object {
133-
"type": "git",
134-
"url": "https://github.com/mattiaerre/oc-hub/tree/master/oc-columbus-header",
135-
},
136-
"version": "1.1.0",
137-
},
138-
Object {
139-
"allVersions": Array [
140-
"1.0.4",
141-
"1.0.3",
142-
"1.0.2",
143-
"1.0.1",
144-
"1.0.0",
145-
],
146-
"author": Object {
147-
"email": "[email protected]",
148-
"name": "Mattia Richetto",
149-
},
150-
"description": "This example shows how to make an HTTP POST request w/ OpenComponents.",
151-
"name": "oc-feedback-form",
152-
"parameters": Array [],
153-
"repository": Object {
154-
"type": "git",
155-
"url": "https://github.com/mattiaerre/oc-hub/tree/master/oc-feedback-form",
156-
},
157-
"version": "1.0.4",
158-
},
159-
Object {
160-
"allVersions": Array [
161-
"1.0.0-alpha.2",
162-
"1.0.0-alpha.1",
163-
],
164-
"author": Object {
165-
"email": "[email protected]",
166-
"name": "Mattia Richetto",
167-
},
168-
"description": "oc-micro-api",
169-
"name": "oc-micro-api",
170-
"parameters": Array [],
171-
"repository": Object {
172-
"type": "git",
173-
"url": "https://github.com/mattiaerre/oc-hub/tree/master/oc-micro-api",
174-
},
175-
"version": "1.0.0-alpha.2",
176-
},
177-
Object {
178-
"allVersions": Array [
179-
"1.7.0",
180-
"1.6.1",
181-
"1.6.0",
182-
"1.5.0",
183-
"1.4.0",
184-
"1.3.0",
185-
"1.2.0",
186-
"1.1.0",
187-
"1.0.0",
188-
],
189-
"author": Object {
190-
"email": "[email protected]",
191-
"name": "Mattia Richetto",
192-
},
193-
"description": "When, from where and what is going to be my next run.",
194-
"name": "oc-my-next-run",
195-
"parameters": Array [
196-
Object {
197-
"description": "The id of the run to display",
198-
"example": "2017-03-19",
199-
"key": "id",
200-
"mandatory": true,
201-
"type": "string",
202-
},
203-
],
204-
"repository": Object {
205-
"type": "git",
206-
"url": "https://github.com/mattiaerre/oc-hub/tree/master/oc-my-next-run",
207-
},
208-
"version": "1.7.0",
209-
},
210-
Object {
211-
"allVersions": Array [
212-
"1.1.1",
213-
"1.1.0",
214-
"1.0.0",
215-
],
216-
"author": Object {
217-
"email": "[email protected]",
218-
"name": "Mattia Richetto",
219-
},
220-
"description": "The list of my social media; this component is used in https://mattiaerre.github.io's footer",
221-
"name": "oc-social-media-buttons",
222-
"parameters": Array [],
223-
"repository": Object {
224-
"type": "git",
225-
"url": "https://github.com/mattiaerre/oc-hub/tree/master/oc-social-media-buttons",
226-
},
227-
"version": "1.1.1",
228-
},
229-
Object {
230-
"allVersions": Array [
231-
"1.0.0",
232-
],
233-
"author": Object {
234-
"email": "[email protected]",
235-
"name": "Mattia Richetto",
236-
},
237-
"description": "This is sometimes called timeago or relative time.",
238-
"name": "oc-timeago",
239-
"parameters": Array [
240-
Object {
241-
"description": "The start date as string in a YYYY-MM-DD format",
242-
"example": "2016-02-22",
243-
"key": "start",
244-
"mandatory": true,
245-
"type": "string",
246-
},
247-
Object {
248-
"description": "The end date as string in a YYYY-MM-DD format",
249-
"example": "2017-02-22",
250-
"key": "end",
251-
"mandatory": false,
252-
"type": "string",
253-
},
254-
],
255-
"repository": Object {
256-
"type": "git",
257-
"url": "https://github.com/mattiaerre/oc-hub/tree/master/oc-timeago",
258-
},
259-
"version": "1.0.0",
260-
},
261-
Object {
262-
"allVersions": Array [
263-
"1.0.1",
264-
"1.0.0",
265-
"1.0.0-alpha.1",
266-
],
267-
"author": Object {
268-
"email": "[email protected]",
269-
"name": "Mattia Richetto",
270-
},
271-
"description": "This is the Google Universal Analytics tracking code for a given Tracking ID.",
272-
"name": "oc-ua-tracking-code",
273-
"parameters": Array [
274-
Object {
275-
"description": "The Google Analytics Tracking ID",
276-
"example": "UA-12345678-9",
277-
"key": "trackingId",
278-
"mandatory": true,
279-
"type": "string",
280-
},
281-
],
282-
"repository": Object {
283-
"type": "git",
284-
"url": "https://github.com/mattiaerre/oc-ua-tracking-code/tree/master/oc-micro-api",
285-
},
286-
"version": "1.0.1",
287-
},
288-
Object {
289-
"allVersions": Array [
290-
"1.1.1",
291-
"1.1.0",
292-
"1.0.1",
293-
"1.0.0",
294-
],
295-
"author": Object {
296-
"email": "[email protected]",
297-
"name": "Mattia Richetto",
298-
},
299-
"description": "oc-with-react",
300-
"name": "oc-with-react",
301-
"parameters": Array [],
302-
"repository": Object {
303-
"type": null,
304-
"url": null,
305-
},
306-
"version": "1.1.1",
307-
},
308-
],
28+
"components": Array [],
30929
"registry": Object {
31030
"dependencies": Array [
31131
"graphql",
31232
"lodash",
31333
"moment",
31434
],
315-
"href": "https://pink-pineapple.herokuapp.com/",
316-
"ocVersion": "0.37.4",
317-
"type": "oc-registry",
35+
"href": null,
36+
"ocVersion": null,
37+
"type": null,
31838
},
31939
},
32040
}

__tests__/component.info.sample.json

Lines changed: 0 additions & 56 deletions
This file was deleted.

__tests__/index.test.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// const fetch = require('node-fetch');
1+
const fetch = require('node-fetch');
22
const factory = require('../src');
33

44
const options = {
@@ -67,6 +67,8 @@ test('expect type of middleware to be function', () => {
6767
});
6868

6969
test('expect res setHeader and end to match snapshot', async () => {
70+
fetch.mockResponse(JSON.stringify({}));
71+
7072
const req = {
7173
method: 'GET',
7274
headers: {

0 commit comments

Comments
 (0)