71 |
72 | );
73 |
74 | export default Home;
75 |
--------------------------------------------------------------------------------
/flow-typed/npm/jest_v22.x.x.js:
--------------------------------------------------------------------------------
1 | // flow-typed signature: 5f6b80ba0fa4571aac1e7ea6e5fea425
2 | // flow-typed version: f4a7859cd3/jest_v22.x.x/flow_>=v0.39.x
3 |
4 | type JestMockFn, TReturn> = {
5 | (...args: TArguments): TReturn,
6 | /**
7 | * An object for introspecting mock calls
8 | */
9 | mock: {
10 | /**
11 | * An array that represents all calls that have been made into this mock
12 | * function. Each call is represented by an array of arguments that were
13 | * passed during the call.
14 | */
15 | calls: Array,
16 | /**
17 | * An array that contains all the object instances that have been
18 | * instantiated from this mock function.
19 | */
20 | instances: Array
21 | },
22 | /**
23 | * Resets all information stored in the mockFn.mock.calls and
24 | * mockFn.mock.instances arrays. Often this is useful when you want to clean
25 | * up a mock's usage data between two assertions.
26 | */
27 | mockClear(): void,
28 | /**
29 | * Resets all information stored in the mock. This is useful when you want to
30 | * completely restore a mock back to its initial state.
31 | */
32 | mockReset(): void,
33 | /**
34 | * Removes the mock and restores the initial implementation. This is useful
35 | * when you want to mock functions in certain test cases and restore the
36 | * original implementation in others. Beware that mockFn.mockRestore only
37 | * works when mock was created with jest.spyOn. Thus you have to take care of
38 | * restoration yourself when manually assigning jest.fn().
39 | */
40 | mockRestore(): void,
41 | /**
42 | * Accepts a function that should be used as the implementation of the mock.
43 | * The mock itself will still record all calls that go into and instances
44 | * that come from itself -- the only difference is that the implementation
45 | * will also be executed when the mock is called.
46 | */
47 | mockImplementation(
48 | fn: (...args: TArguments) => TReturn
49 | ): JestMockFn,
50 | /**
51 | * Accepts a function that will be used as an implementation of the mock for
52 | * one call to the mocked function. Can be chained so that multiple function
53 | * calls produce different results.
54 | */
55 | mockImplementationOnce(
56 | fn: (...args: TArguments) => TReturn
57 | ): JestMockFn,
58 | /**
59 | * Accepts a string to use in test result output in place of "jest.fn()" to
60 | * indicate which mock function is being referenced.
61 | */
62 | mockName(name: string): JestMockFn,
63 | /**
64 | * Just a simple sugar function for returning `this`
65 | */
66 | mockReturnThis(): void,
67 | /**
68 | * Deprecated: use jest.fn(() => value) instead
69 | */
70 | mockReturnValue(value: TReturn): JestMockFn,
71 | /**
72 | * Sugar for only returning a value once inside your mock
73 | */
74 | mockReturnValueOnce(value: TReturn): JestMockFn
75 | };
76 |
77 | type JestAsymmetricEqualityType = {
78 | /**
79 | * A custom Jasmine equality tester
80 | */
81 | asymmetricMatch(value: mixed): boolean
82 | };
83 |
84 | type JestCallsType = {
85 | allArgs(): mixed,
86 | all(): mixed,
87 | any(): boolean,
88 | count(): number,
89 | first(): mixed,
90 | mostRecent(): mixed,
91 | reset(): void
92 | };
93 |
94 | type JestClockType = {
95 | install(): void,
96 | mockDate(date: Date): void,
97 | tick(milliseconds?: number): void,
98 | uninstall(): void
99 | };
100 |
101 | type JestMatcherResult = {
102 | message?: string | (() => string),
103 | pass: boolean
104 | };
105 |
106 | type JestMatcher = (actual: any, expected: any) => JestMatcherResult;
107 |
108 | type JestPromiseType = {
109 | /**
110 | * Use rejects to unwrap the reason of a rejected promise so any other
111 | * matcher can be chained. If the promise is fulfilled the assertion fails.
112 | */
113 | rejects: JestExpectType,
114 | /**
115 | * Use resolves to unwrap the value of a fulfilled promise so any other
116 | * matcher can be chained. If the promise is rejected the assertion fails.
117 | */
118 | resolves: JestExpectType
119 | };
120 |
121 | /**
122 | * Jest allows functions and classes to be used as test names in test() and
123 | * describe()
124 | */
125 | type JestTestName = string | Function;
126 |
127 | /**
128 | * Plugin: jest-enzyme
129 | */
130 | type EnzymeMatchersType = {
131 | toBeChecked(): void,
132 | toBeDisabled(): void,
133 | toBeEmpty(): void,
134 | toBeEmptyRender(): void,
135 | toBePresent(): void,
136 | toContainReact(element: React$Element): void,
137 | toExist(): void,
138 | toHaveClassName(className: string): void,
139 | toHaveHTML(html: string): void,
140 | toHaveProp: ((propKey: string, propValue?: any) => void) & ((props: Object) => void),
141 | toHaveRef(refName: string): void,
142 | toHaveState: ((stateKey: string, stateValue?: any) => void) & ((state: Object) => void),
143 | toHaveStyle: ((styleKey: string, styleValue?: any) => void) & ((style: Object) => void),
144 | toHaveTagName(tagName: string): void,
145 | toHaveText(text: string): void,
146 | toIncludeText(text: string): void,
147 | toHaveValue(value: any): void,
148 | toMatchElement(element: React$Element): void,
149 | toMatchSelector(selector: string): void
150 | };
151 |
152 | // DOM testing library extensions https://github.com/kentcdodds/dom-testing-library#custom-jest-matchers
153 | type DomTestingLibraryType = {
154 | toBeInTheDOM(): void,
155 | toHaveTextContent(content: string): void,
156 | toHaveAttribute(name: string, expectedValue?: string): void
157 | };
158 |
159 | // Jest JQuery Matchers: https://github.com/unindented/custom-jquery-matchers
160 | type JestJQueryMatchersType = {
161 | toExist(): void,
162 | toHaveLength(len: number): void,
163 | toHaveId(id: string): void,
164 | toHaveClass(className: string): void,
165 | toHaveTag(tag: string): void,
166 | toHaveAttr(key: string, val?: any): void,
167 | toHaveProp(key: string, val?: any): void,
168 | toHaveText(text: string | RegExp): void,
169 | toHaveData(key: string, val?: any): void,
170 | toHaveValue(val: any): void,
171 | toHaveCss(css: {[key: string]: any}): void,
172 | toBeChecked(): void,
173 | toBeDisabled(): void,
174 | toBeEmpty(): void,
175 | toBeHidden(): void,
176 | toBeSelected(): void,
177 | toBeVisible(): void,
178 | toBeFocused(): void,
179 | toBeInDom(): void,
180 | toBeMatchedBy(sel: string): void,
181 | toHaveDescendant(sel: string): void,
182 | toHaveDescendantWithText(sel: string, text: string | RegExp): void
183 | };
184 |
185 |
186 | // Jest Extended Matchers: https://github.com/jest-community/jest-extended
187 | type JestExtendedMatchersType = {
188 | /**
189 | * Note: Currently unimplemented
190 | * Passing assertion
191 | *
192 | * @param {String} message
193 | */
194 | // pass(message: string): void;
195 |
196 | /**
197 | * Note: Currently unimplemented
198 | * Failing assertion
199 | *
200 | * @param {String} message
201 | */
202 | // fail(message: string): void;
203 |
204 | /**
205 | * Use .toBeEmpty when checking if a String '', Array [] or Object {} is empty.
206 | */
207 | toBeEmpty(): void;
208 |
209 | /**
210 | * Use .toBeOneOf when checking if a value is a member of a given Array.
211 | * @param {Array.<*>} members
212 | */
213 | toBeOneOf(members: any[]): void;
214 |
215 | /**
216 | * Use `.toBeNil` when checking a value is `null` or `undefined`.
217 | */
218 | toBeNil(): void;
219 |
220 | /**
221 | * Use `.toSatisfy` when you want to use a custom matcher by supplying a predicate function that returns a `Boolean`.
222 | * @param {Function} predicate
223 | */
224 | toSatisfy(predicate: (n: any) => boolean): void;
225 |
226 | /**
227 | * Use `.toBeArray` when checking if a value is an `Array`.
228 | */
229 | toBeArray(): void;
230 |
231 | /**
232 | * Use `.toBeArrayOfSize` when checking if a value is an `Array` of size x.
233 | * @param {Number} x
234 | */
235 | toBeArrayOfSize(x: number): void;
236 |
237 | /**
238 | * Use `.toIncludeAllMembers` when checking if an `Array` contains all of the same members of a given set.
239 | * @param {Array.<*>} members
240 | */
241 | toIncludeAllMembers(members: any[]): void;
242 |
243 | /**
244 | * Use `.toIncludeAnyMembers` when checking if an `Array` contains any of the members of a given set.
245 | * @param {Array.<*>} members
246 | */
247 | toIncludeAnyMembers(members: any[]): void;
248 |
249 | /**
250 | * Use `.toSatisfyAll` when you want to use a custom matcher by supplying a predicate function that returns a `Boolean` for all values in an array.
251 | * @param {Function} predicate
252 | */
253 | toSatisfyAll(predicate: (n: any) => boolean): void;
254 |
255 | /**
256 | * Use `.toBeBoolean` when checking if a value is a `Boolean`.
257 | */
258 | toBeBoolean(): void;
259 |
260 | /**
261 | * Use `.toBeTrue` when checking a value is equal (===) to `true`.
262 | */
263 | toBeTrue(): void;
264 |
265 | /**
266 | * Use `.toBeFalse` when checking a value is equal (===) to `false`.
267 | */
268 | toBeFalse(): void;
269 |
270 | /**
271 | * Use .toBeDate when checking if a value is a Date.
272 | */
273 | toBeDate(): void;
274 |
275 | /**
276 | * Use `.toBeFunction` when checking if a value is a `Function`.
277 | */
278 | toBeFunction(): void;
279 |
280 | /**
281 | * Use `.toHaveBeenCalledBefore` when checking if a `Mock` was called before another `Mock`.
282 | *
283 | * Note: Required Jest version >22
284 | * Note: Your mock functions will have to be asynchronous to cause the timestamps inside of Jest to occur in a differentJS event loop, otherwise the mock timestamps will all be the same
285 | *
286 | * @param {Mock} mock
287 | */
288 | toHaveBeenCalledBefore(mock: JestMockFn): void;
289 |
290 | /**
291 | * Use `.toBeNumber` when checking if a value is a `Number`.
292 | */
293 | toBeNumber(): void;
294 |
295 | /**
296 | * Use `.toBeNaN` when checking a value is `NaN`.
297 | */
298 | toBeNaN(): void;
299 |
300 | /**
301 | * Use `.toBeFinite` when checking if a value is a `Number`, not `NaN` or `Infinity`.
302 | */
303 | toBeFinite(): void;
304 |
305 | /**
306 | * Use `.toBePositive` when checking if a value is a positive `Number`.
307 | */
308 | toBePositive(): void;
309 |
310 | /**
311 | * Use `.toBeNegative` when checking if a value is a negative `Number`.
312 | */
313 | toBeNegative(): void;
314 |
315 | /**
316 | * Use `.toBeEven` when checking if a value is an even `Number`.
317 | */
318 | toBeEven(): void;
319 |
320 | /**
321 | * Use `.toBeOdd` when checking if a value is an odd `Number`.
322 | */
323 | toBeOdd(): void;
324 |
325 | /**
326 | * Use `.toBeWithin` when checking if a number is in between the given bounds of: start (inclusive) and end (exclusive).
327 | *
328 | * @param {Number} start
329 | * @param {Number} end
330 | */
331 | toBeWithin(start: number, end: number): void;
332 |
333 | /**
334 | * Use `.toBeObject` when checking if a value is an `Object`.
335 | */
336 | toBeObject(): void;
337 |
338 | /**
339 | * Use `.toContainKey` when checking if an object contains the provided key.
340 | *
341 | * @param {String} key
342 | */
343 | toContainKey(key: string): void;
344 |
345 | /**
346 | * Use `.toContainKeys` when checking if an object has all of the provided keys.
347 | *
348 | * @param {Array.} keys
349 | */
350 | toContainKeys(keys: string[]): void;
351 |
352 | /**
353 | * Use `.toContainAllKeys` when checking if an object only contains all of the provided keys.
354 | *
355 | * @param {Array.} keys
356 | */
357 | toContainAllKeys(keys: string[]): void;
358 |
359 | /**
360 | * Use `.toContainAnyKeys` when checking if an object contains at least one of the provided keys.
361 | *
362 | * @param {Array.} keys
363 | */
364 | toContainAnyKeys(keys: string[]): void;
365 |
366 | /**
367 | * Use `.toContainValue` when checking if an object contains the provided value.
368 | *
369 | * @param {*} value
370 | */
371 | toContainValue(value: any): void;
372 |
373 | /**
374 | * Use `.toContainValues` when checking if an object contains all of the provided values.
375 | *
376 | * @param {Array.<*>} values
377 | */
378 | toContainValues(values: any[]): void;
379 |
380 | /**
381 | * Use `.toContainAllValues` when checking if an object only contains all of the provided values.
382 | *
383 | * @param {Array.<*>} values
384 | */
385 | toContainAllValues(values: any[]): void;
386 |
387 | /**
388 | * Use `.toContainAnyValues` when checking if an object contains at least one of the provided values.
389 | *
390 | * @param {Array.<*>} values
391 | */
392 | toContainAnyValues(values: any[]): void;
393 |
394 | /**
395 | * Use `.toContainEntry` when checking if an object contains the provided entry.
396 | *
397 | * @param {Array.} entry
398 | */
399 | toContainEntry(entry: [string, string]): void;
400 |
401 | /**
402 | * Use `.toContainEntries` when checking if an object contains all of the provided entries.
403 | *
404 | * @param {Array.>} entries
405 | */
406 | toContainEntries(entries: [string, string][]): void;
407 |
408 | /**
409 | * Use `.toContainAllEntries` when checking if an object only contains all of the provided entries.
410 | *
411 | * @param {Array.>} entries
412 | */
413 | toContainAllEntries(entries: [string, string][]): void;
414 |
415 | /**
416 | * Use `.toContainAnyEntries` when checking if an object contains at least one of the provided entries.
417 | *
418 | * @param {Array.>} entries
419 | */
420 | toContainAnyEntries(entries: [string, string][]): void;
421 |
422 | /**
423 | * Use `.toBeExtensible` when checking if an object is extensible.
424 | */
425 | toBeExtensible(): void;
426 |
427 | /**
428 | * Use `.toBeFrozen` when checking if an object is frozen.
429 | */
430 | toBeFrozen(): void;
431 |
432 | /**
433 | * Use `.toBeSealed` when checking if an object is sealed.
434 | */
435 | toBeSealed(): void;
436 |
437 | /**
438 | * Use `.toBeString` when checking if a value is a `String`.
439 | */
440 | toBeString(): void;
441 |
442 | /**
443 | * Use `.toEqualCaseInsensitive` when checking if a string is equal (===) to another ignoring the casing of both strings.
444 | *
445 | * @param {String} string
446 | */
447 | toEqualCaseInsensitive(string: string): void;
448 |
449 | /**
450 | * Use `.toStartWith` when checking if a `String` starts with a given `String` prefix.
451 | *
452 | * @param {String} prefix
453 | */
454 | toStartWith(prefix: string): void;
455 |
456 | /**
457 | * Use `.toEndWith` when checking if a `String` ends with a given `String` suffix.
458 | *
459 | * @param {String} suffix
460 | */
461 | toEndWith(suffix: string): void;
462 |
463 | /**
464 | * Use `.toInclude` when checking if a `String` includes the given `String` substring.
465 | *
466 | * @param {String} substring
467 | */
468 | toInclude(substring: string): void;
469 |
470 | /**
471 | * Use `.toIncludeRepeated` when checking if a `String` includes the given `String` substring the correct number of times.
472 | *
473 | * @param {String} substring
474 | * @param {Number} times
475 | */
476 | toIncludeRepeated(substring: string, times: number): void;
477 |
478 | /**
479 | * Use `.toIncludeMultiple` when checking if a `String` includes all of the given substrings.
480 | *
481 | * @param {Array.} substring
482 | */
483 | toIncludeMultiple(substring: string[]): void;
484 | };
485 |
486 | type JestExpectType = {
487 | not: JestExpectType & EnzymeMatchersType & DomTestingLibraryType & JestJQueryMatchersType & JestExtendedMatchersType,
488 | /**
489 | * If you have a mock function, you can use .lastCalledWith to test what
490 | * arguments it was last called with.
491 | */
492 | lastCalledWith(...args: Array): void,
493 | /**
494 | * toBe just checks that a value is what you expect. It uses === to check
495 | * strict equality.
496 | */
497 | toBe(value: any): void,
498 | /**
499 | * Use .toHaveBeenCalled to ensure that a mock function got called.
500 | */
501 | toBeCalled(): void,
502 | /**
503 | * Use .toBeCalledWith to ensure that a mock function was called with
504 | * specific arguments.
505 | */
506 | toBeCalledWith(...args: Array): void,
507 | /**
508 | * Using exact equality with floating point numbers is a bad idea. Rounding
509 | * means that intuitive things fail.
510 | */
511 | toBeCloseTo(num: number, delta: any): void,
512 | /**
513 | * Use .toBeDefined to check that a variable is not undefined.
514 | */
515 | toBeDefined(): void,
516 | /**
517 | * Use .toBeFalsy when you don't care what a value is, you just want to
518 | * ensure a value is false in a boolean context.
519 | */
520 | toBeFalsy(): void,
521 | /**
522 | * To compare floating point numbers, you can use toBeGreaterThan.
523 | */
524 | toBeGreaterThan(number: number): void,
525 | /**
526 | * To compare floating point numbers, you can use toBeGreaterThanOrEqual.
527 | */
528 | toBeGreaterThanOrEqual(number: number): void,
529 | /**
530 | * To compare floating point numbers, you can use toBeLessThan.
531 | */
532 | toBeLessThan(number: number): void,
533 | /**
534 | * To compare floating point numbers, you can use toBeLessThanOrEqual.
535 | */
536 | toBeLessThanOrEqual(number: number): void,
537 | /**
538 | * Use .toBeInstanceOf(Class) to check that an object is an instance of a
539 | * class.
540 | */
541 | toBeInstanceOf(cls: Class<*>): void,
542 | /**
543 | * .toBeNull() is the same as .toBe(null) but the error messages are a bit
544 | * nicer.
545 | */
546 | toBeNull(): void,
547 | /**
548 | * Use .toBeTruthy when you don't care what a value is, you just want to
549 | * ensure a value is true in a boolean context.
550 | */
551 | toBeTruthy(): void,
552 | /**
553 | * Use .toBeUndefined to check that a variable is undefined.
554 | */
555 | toBeUndefined(): void,
556 | /**
557 | * Use .toContain when you want to check that an item is in a list. For
558 | * testing the items in the list, this uses ===, a strict equality check.
559 | */
560 | toContain(item: any): void,
561 | /**
562 | * Use .toContainEqual when you want to check that an item is in a list. For
563 | * testing the items in the list, this matcher recursively checks the
564 | * equality of all fields, rather than checking for object identity.
565 | */
566 | toContainEqual(item: any): void,
567 | /**
568 | * Use .toEqual when you want to check that two objects have the same value.
569 | * This matcher recursively checks the equality of all fields, rather than
570 | * checking for object identity.
571 | */
572 | toEqual(value: any): void,
573 | /**
574 | * Use .toHaveBeenCalled to ensure that a mock function got called.
575 | */
576 | toHaveBeenCalled(): void,
577 | /**
578 | * Use .toHaveBeenCalledTimes to ensure that a mock function got called exact
579 | * number of times.
580 | */
581 | toHaveBeenCalledTimes(number: number): void,
582 | /**
583 | * Use .toHaveBeenCalledWith to ensure that a mock function was called with
584 | * specific arguments.
585 | */
586 | toHaveBeenCalledWith(...args: Array): void,
587 | /**
588 | * Use .toHaveBeenLastCalledWith to ensure that a mock function was last called
589 | * with specific arguments.
590 | */
591 | toHaveBeenLastCalledWith(...args: Array): void,
592 | /**
593 | * Check that an object has a .length property and it is set to a certain
594 | * numeric value.
595 | */
596 | toHaveLength(number: number): void,
597 | /**
598 | *
599 | */
600 | toHaveProperty(propPath: string, value?: any): void,
601 | /**
602 | * Use .toMatch to check that a string matches a regular expression or string.
603 | */
604 | toMatch(regexpOrString: RegExp | string): void,
605 | /**
606 | * Use .toMatchObject to check that a javascript object matches a subset of the properties of an object.
607 | */
608 | toMatchObject(object: Object | Array