jekyll-theme-hydejack 9.0.4 → 9.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/_config.yml +5 -4
- data/_includes/body/breadcrumbs.html +19 -0
- data/_includes/body/footer.html +1 -1
- data/_includes/body/index.html +3 -2
- data/_includes/body/main.html +1 -0
- data/_includes/body/nav.html +3 -3
- data/_includes/body/scripts.html +2 -2
- data/_includes/body/sidebar.html +1 -1
- data/_includes/components/dingbat.html +13 -0
- data/_includes/components/post.html +35 -9
- data/_includes/components/tag-list.html +24 -24
- data/_includes/head/index.html +1 -1
- data/_includes/head/links-static.html +7 -4
- data/_includes/head/meta-static.html +1 -1
- data/_includes/head/scripts.html +7 -2
- data/_includes/head/styles-inline.html +4 -2
- data/_includes/head/styles-no-inline.html +4 -2
- data/_includes/header.txt +1 -1
- data/_includes/scripts.html +33 -0
- data/_includes/scripts/load-js.min.js +1 -1
- data/_includes/scripts/nomodule.min.js +1 -1
- data/_includes/smart-url +10 -1
- data/_includes/styles/page-style.scss +1 -0
- data/_includes/styles/style.scss +1 -0
- data/_includes/styles/variables.scss +4 -2
- data/_includes/templates/animation.html +1 -0
- data/_includes/templates/index.html +20 -2
- data/_layouts/about.html +4 -1
- data/_layouts/base.html +3 -12
- data/_layouts/compress.html +1 -1
- data/_layouts/page.html +4 -2
- data/_layouts/plain.html +29 -0
- data/_layouts/post.html +6 -1
- data/_sass/_mixins.scss +26 -3
- data/_sass/_tippy.scss +41 -0
- data/_sass/html.scss +1 -7
- data/_sass/hydejack/__inline__/_base.scss +23 -1
- data/_sass/hydejack/__inline__/_content.scss +5 -1
- data/_sass/hydejack/__inline__/_sidebar.scss +18 -4
- data/_sass/hydejack/__inline__/_toc.scss +9 -5
- data/_sass/hydejack/__inline__/_utilities.scss +25 -0
- data/_sass/hydejack/__link__/_base.scss +1 -1
- data/_sass/hydejack/__link__/_break-layout.scss +8 -1
- data/_sass/hydejack/__link__/_images.scss +1 -1
- data/_sass/hydejack/__link__/_sidebar.scss +15 -5
- data/_sass/hydejack/__link__/_toc.scss +4 -4
- data/_sass/hydejack/__link__/_utilities.scss +25 -0
- data/_sass/hydejack/_base.pre.scss +23 -1
- data/_sass/hydejack/_break-layout.pre.scss +8 -1
- data/_sass/hydejack/_content.pre.scss +5 -1
- data/_sass/hydejack/_images.pre.scss +1 -1
- data/_sass/hydejack/_sidebar.pre.scss +29 -5
- data/_sass/hydejack/_toc.pre.scss +12 -6
- data/_sass/hydejack/_utilities.pre.scss +25 -0
- data/_sass/pooleparty/__inline__/_base.scss +2 -0
- data/_sass/pooleparty/__inline__/_code.scss +1 -1
- data/_sass/pooleparty/__inline__/_message.scss +1 -1
- data/_sass/pooleparty/__inline__/_posts.scss +19 -3
- data/_sass/pooleparty/__inline__/_type.scss +4 -2
- data/_sass/pooleparty/__link__/_code.scss +138 -27
- data/_sass/pooleparty/__link__/_footnotes.scss +2 -1
- data/_sass/pooleparty/__link__/_posts.scss +12 -0
- data/_sass/pooleparty/__link__/_read-more.scss +1 -0
- data/_sass/pooleparty/__link__/_table.scss +30 -36
- data/_sass/pooleparty/__link__/_type.scss +4 -2
- data/_sass/pooleparty/_base.pre.scss +2 -0
- data/_sass/pooleparty/_code.pre.scss +138 -27
- data/_sass/pooleparty/_footnotes.pre.scss +2 -1
- data/_sass/pooleparty/_message.pre.scss +1 -1
- data/_sass/pooleparty/_posts.pre.scss +31 -3
- data/_sass/pooleparty/_read-more.pre.scss +1 -0
- data/_sass/pooleparty/_table.pre.scss +30 -36
- data/_sass/pooleparty/_type.pre.scss +6 -4
- data/_sass/tippyjs/_mixins.scss +25 -0
- data/_sass/tippyjs/_vars.scss +6 -0
- data/_sass/tippyjs/animations/fade.scss +8 -0
- data/_sass/tippyjs/index.scss +90 -0
- data/assets/bower.json +2 -1
- data/assets/bower_components/MathJax/.bower.json +5 -5
- data/assets/bower_components/MathJax/es5/a11y/assistive-mml.js +1 -1
- data/assets/bower_components/MathJax/es5/a11y/complexity.js +1 -1
- data/assets/bower_components/MathJax/es5/a11y/explorer.js +1 -1
- data/assets/bower_components/MathJax/es5/a11y/semantic-enrich.js +1 -1
- data/assets/bower_components/MathJax/es5/adaptors/liteDOM.js +1 -1
- data/assets/bower_components/MathJax/es5/core.js +1 -1
- data/assets/bower_components/MathJax/es5/input/asciimath.js +1 -1
- data/assets/bower_components/MathJax/es5/input/mml.js +1 -1
- data/assets/bower_components/MathJax/es5/input/mml/entities.js +1 -1
- data/assets/bower_components/MathJax/es5/input/tex-base.js +1 -1
- data/assets/bower_components/MathJax/es5/input/tex-full.js +1 -1
- data/assets/bower_components/MathJax/es5/input/tex.js +1 -1
- data/assets/bower_components/MathJax/es5/input/tex/extensions/action.js +1 -1
- data/assets/bower_components/MathJax/es5/input/tex/extensions/all-packages.js +1 -1
- data/assets/bower_components/MathJax/es5/input/tex/extensions/ams.js +1 -1
- data/assets/bower_components/MathJax/es5/input/tex/extensions/amscd.js +1 -1
- data/assets/bower_components/MathJax/es5/input/tex/extensions/autoload.js +1 -1
- data/assets/bower_components/MathJax/es5/input/tex/extensions/bbox.js +1 -1
- data/assets/bower_components/MathJax/es5/input/tex/extensions/boldsymbol.js +1 -1
- data/assets/bower_components/MathJax/es5/input/tex/extensions/braket.js +1 -1
- data/assets/bower_components/MathJax/es5/input/tex/extensions/bussproofs.js +1 -1
- data/assets/bower_components/MathJax/es5/input/tex/extensions/cancel.js +1 -1
- data/assets/bower_components/MathJax/es5/input/tex/extensions/color.js +1 -1
- data/assets/bower_components/MathJax/es5/input/tex/extensions/colorV2.js +1 -1
- data/assets/bower_components/MathJax/es5/input/tex/extensions/configMacros.js +1 -1
- data/assets/bower_components/MathJax/es5/input/tex/extensions/enclose.js +1 -1
- data/assets/bower_components/MathJax/es5/input/tex/extensions/extpfeil.js +1 -1
- data/assets/bower_components/MathJax/es5/input/tex/extensions/html.js +1 -1
- data/assets/bower_components/MathJax/es5/input/tex/extensions/mhchem.js +1 -1
- data/assets/bower_components/MathJax/es5/input/tex/extensions/newcommand.js +1 -1
- data/assets/bower_components/MathJax/es5/input/tex/extensions/noerrors.js +1 -1
- data/assets/bower_components/MathJax/es5/input/tex/extensions/noundefined.js +1 -1
- data/assets/bower_components/MathJax/es5/input/tex/extensions/physics.js +1 -1
- data/assets/bower_components/MathJax/es5/input/tex/extensions/require.js +1 -1
- data/assets/bower_components/MathJax/es5/input/tex/extensions/tagFormat.js +1 -1
- data/assets/bower_components/MathJax/es5/input/tex/extensions/textmacros.js +1 -0
- data/assets/bower_components/MathJax/es5/input/tex/extensions/unicode.js +1 -1
- data/assets/bower_components/MathJax/es5/input/tex/extensions/verb.js +1 -1
- data/assets/bower_components/MathJax/es5/latest.js +1 -1
- data/assets/bower_components/MathJax/es5/loader.js +1 -1
- data/assets/bower_components/MathJax/es5/mml-chtml.js +1 -1
- data/assets/bower_components/MathJax/es5/mml-svg.js +1 -1
- data/assets/bower_components/MathJax/es5/node-main.js +1 -1
- data/assets/bower_components/MathJax/es5/output/chtml.js +1 -1
- data/assets/bower_components/MathJax/es5/output/chtml/fonts/tex.js +1 -1
- data/assets/bower_components/MathJax/es5/output/svg.js +1 -1
- data/assets/bower_components/MathJax/es5/output/svg/fonts/tex.js +1 -1
- data/assets/bower_components/MathJax/es5/sre/mathmaps/de.js +104 -0
- data/assets/bower_components/MathJax/es5/sre/mathmaps/en.js +11 -5
- data/assets/bower_components/MathJax/es5/sre/mathmaps/es.js +1 -1
- data/assets/bower_components/MathJax/es5/sre/mathmaps/mathmaps_ie.js +117 -9
- data/assets/bower_components/MathJax/es5/sre/mathmaps/nemeth.js +3 -3
- data/assets/bower_components/MathJax/es5/sre/sre-node.js +11 -0
- data/assets/bower_components/MathJax/es5/sre/sre_browser.js +1110 -1186
- data/assets/bower_components/MathJax/es5/startup.js +1 -1
- data/assets/bower_components/MathJax/es5/tex-chtml-full.js +1 -1
- data/assets/bower_components/MathJax/es5/tex-chtml.js +1 -1
- data/assets/bower_components/MathJax/es5/tex-mml-chtml.js +1 -1
- data/assets/bower_components/MathJax/es5/tex-mml-svg.js +1 -1
- data/assets/bower_components/MathJax/es5/tex-svg-full.js +1 -1
- data/assets/bower_components/MathJax/es5/tex-svg.js +1 -1
- data/assets/bower_components/MathJax/es5/ui/menu.js +1 -1
- data/assets/bower_components/MathJax/es5/ui/safe.js +1 -0
- data/assets/bower_components/MathJax/package.json +3 -3
- data/assets/bower_components/katex/.bower.json +7 -6
- data/assets/bower_components/katex/dist/contrib/render-a11y-string.js +858 -0
- data/assets/bower_components/katex/dist/contrib/render-a11y-string.min.js +1 -0
- data/assets/bower_components/katex/dist/contrib/render-a11y-string.mjs +741 -0
- data/assets/bower_components/katex/dist/katex.css +1 -10
- data/assets/bower_components/katex/dist/katex.js +1228 -612
- data/assets/bower_components/katex/dist/katex.min.css +1 -1
- data/assets/bower_components/katex/dist/katex.min.js +1 -1
- data/assets/bower_components/katex/dist/katex.mjs +1270 -591
- data/assets/bower_components/katex/docs/cli.md.template +21 -0
- data/assets/bower_components/katex/flow-typed/npm/jest_v24.x.x.js +1201 -0
- data/assets/bower_components/katex/yarn.lock +233 -172
- data/assets/css/{hydejack-9.0.4.css → hydejack-9.1.4.css} +0 -0
- data/assets/icomoon/fonts/icomoon.eot +0 -0
- data/assets/icomoon/fonts/icomoon.svg +6 -3
- data/assets/icomoon/fonts/icomoon.ttf +0 -0
- data/assets/icomoon/fonts/icomoon.woff +0 -0
- data/assets/icomoon/selection.json +1 -1
- data/assets/icomoon/style.css +17 -8
- data/assets/icons/icon-128x128.png +0 -0
- data/assets/icons/icon-144x144.png +0 -0
- data/assets/icons/icon-152x152.png +0 -0
- data/assets/icons/icon-192x192.png +0 -0
- data/assets/icons/icon-384x384.png +0 -0
- data/assets/icons/icon-512x512.png +0 -0
- data/assets/icons/icon-96x96.png +0 -0
- data/assets/img/logo.png +0 -0
- data/assets/img/sidebar-bg.jpg +0 -0
- data/assets/img/swipe.svg +1 -22
- data/assets/js/LEGACY-clap-button-hydejack-9.1.4.js +14 -0
- data/assets/js/LEGACY-drawer-hydejack-9.1.4.js +14 -0
- data/assets/js/{LEGACY-fetch-hydejack-9.0.4.js → LEGACY-fetch-hydejack-9.1.4.js} +2 -2
- data/assets/js/LEGACY-hydejack-9.1.4.js +27 -0
- data/assets/js/LEGACY-navbar-hydejack-9.1.4.js +14 -0
- data/assets/js/LEGACY-push-state-hydejack-9.1.4.js +14 -0
- data/assets/js/LEGACY-resize-observer-hydejack-9.1.4.js +14 -0
- data/assets/js/{LEGACY-shadydom-hydejack-9.0.4.js → LEGACY-shadydom-hydejack-9.1.4.js} +2 -2
- data/assets/js/LEGACY-vendors~clap-button-hydejack-9.1.4.js +14 -0
- data/assets/js/LEGACY-vendors~drawer-hydejack-9.1.4.js +48 -0
- data/assets/js/LEGACY-vendors~drawer~push-state-hydejack-9.1.4.js +214 -0
- data/assets/js/LEGACY-vendors~fetch-hydejack-9.1.4.js +14 -0
- data/assets/js/LEGACY-vendors~intersection-observer-hydejack-9.1.4.js +14 -0
- data/assets/js/LEGACY-vendors~push-state-hydejack-9.1.4.js +34 -0
- data/assets/js/LEGACY-vendors~shadydom-hydejack-9.1.4.js +155 -0
- data/assets/js/{LEGACY-vendors~webanimations-hydejack-9.0.4.js → LEGACY-vendors~webanimations-hydejack-9.1.4.js} +2 -2
- data/assets/js/{LEGACY-vendors~webcomponents-hydejack-9.0.4.js → LEGACY-vendors~webcomponents-hydejack-9.1.4.js} +4 -4
- data/assets/js/{LEGACY-webcomponents-hydejack-9.0.4.js → LEGACY-webcomponents-hydejack-9.1.4.js} +2 -2
- data/assets/js/clap-button-hydejack-9.1.4.js +14 -0
- data/assets/js/drawer-hydejack-9.1.4.js +14 -0
- data/assets/js/{shadydom-hydejack-9.0.4.js → fetch-hydejack-9.1.4.js} +2 -2
- data/assets/js/hydejack-9.1.4.js +28 -0
- data/assets/js/navbar-hydejack-9.1.4.js +14 -0
- data/assets/js/push-state-hydejack-9.1.4.js +14 -0
- data/assets/js/resize-observer-hydejack-9.1.4.js +14 -0
- data/assets/js/{fetch-hydejack-9.0.4.js → shadydom-hydejack-9.1.4.js} +2 -2
- data/assets/js/vendors~clap-button-hydejack-9.1.4.js +14 -0
- data/assets/js/vendors~drawer-hydejack-9.1.4.js +48 -0
- data/assets/js/vendors~drawer~push-state-hydejack-9.1.4.js +163 -0
- data/assets/js/vendors~fetch-hydejack-9.1.4.js +14 -0
- data/assets/js/vendors~intersection-observer-hydejack-9.1.4.js +14 -0
- data/assets/js/vendors~push-state-hydejack-9.1.4.js +34 -0
- data/assets/js/vendors~shadydom-hydejack-9.1.4.js +146 -0
- data/assets/js/{vendors~webanimations-hydejack-9.0.4.js → vendors~webanimations-hydejack-9.1.4.js} +2 -2
- data/assets/js/{webcomponents-hydejack-9.0.4.js → webcomponents-hydejack-9.1.4.js} +2 -2
- data/assets/site.webmanifest +1 -1
- data/assets/version.json +2 -2
- metadata +59 -47
- data/_includes/templates/back.html +0 -6
- data/_includes/templates/forward.html +0 -6
- data/assets/js/LEGACY-drawer-hydejack-9.0.4.js +0 -14
- data/assets/js/LEGACY-hydejack-9.0.4.js +0 -28
- data/assets/js/LEGACY-navbar-hydejack-9.0.4.js +0 -14
- data/assets/js/LEGACY-push-state-hydejack-9.0.4.js +0 -14
- data/assets/js/LEGACY-resize-observer-hydejack-9.0.4.js +0 -14
- data/assets/js/LEGACY-search-hydejack-9.0.4.js +0 -14
- data/assets/js/LEGACY-toc-hydejack-9.0.4.js +0 -14
- data/assets/js/LEGACY-vendors~drawer-hydejack-9.0.4.js +0 -47
- data/assets/js/LEGACY-vendors~drawer~push-state-hydejack-9.0.4.js +0 -215
- data/assets/js/LEGACY-vendors~drawer~push-state~search-hydejack-9.0.4.js +0 -151
- data/assets/js/LEGACY-vendors~fetch-hydejack-9.0.4.js +0 -14
- data/assets/js/LEGACY-vendors~intersection-observer-hydejack-9.0.4.js +0 -14
- data/assets/js/LEGACY-vendors~push-state-hydejack-9.0.4.js +0 -33
- data/assets/js/LEGACY-vendors~search-hydejack-9.0.4.js +0 -40
- data/assets/js/LEGACY-vendors~shadydom-hydejack-9.0.4.js +0 -155
- data/assets/js/drawer-hydejack-9.0.4.js +0 -14
- data/assets/js/hydejack-9.0.4.js +0 -28
- data/assets/js/navbar-hydejack-9.0.4.js +0 -14
- data/assets/js/push-state-hydejack-9.0.4.js +0 -14
- data/assets/js/resize-observer-hydejack-9.0.4.js +0 -14
- data/assets/js/search-hydejack-9.0.4.js +0 -14
- data/assets/js/toc-hydejack-9.0.4.js +0 -14
- data/assets/js/vendors~drawer-hydejack-9.0.4.js +0 -47
- data/assets/js/vendors~drawer~push-state-hydejack-9.0.4.js +0 -163
- data/assets/js/vendors~drawer~push-state~search-hydejack-9.0.4.js +0 -124
- data/assets/js/vendors~fetch-hydejack-9.0.4.js +0 -14
- data/assets/js/vendors~intersection-observer-hydejack-9.0.4.js +0 -14
- data/assets/js/vendors~push-state-hydejack-9.0.4.js +0 -33
- data/assets/js/vendors~search-hydejack-9.0.4.js +0 -40
- data/assets/js/vendors~shadydom-hydejack-9.0.4.js +0 -146
@@ -0,0 +1,21 @@
|
|
1
|
+
---
|
2
|
+
id: cli
|
3
|
+
title: CLI
|
4
|
+
---
|
5
|
+
|
6
|
+
KaTeX installed [using Node.js package managers](node.md) comes with a
|
7
|
+
built-in command-line interface (CLI) which can be used to render TeX to HTML.
|
8
|
+
By default, CLI will take the input from standard input.
|
9
|
+
|
10
|
+
```bash
|
11
|
+
npx katex
|
12
|
+
```
|
13
|
+
|
14
|
+
> Above uses the `npx` command to run the locally installed executable
|
15
|
+
after `npm install katex`. You can also execute with the relative path:
|
16
|
+
`./node_modules/.bin/katex`
|
17
|
+
|
18
|
+
> To use the CLI from local Git clone, you need to build the project first.
|
19
|
+
See [Building from Source](node.md#building-from-source) for more details.
|
20
|
+
|
21
|
+
## Options
|
@@ -0,0 +1,1201 @@
|
|
1
|
+
// flow-typed signature: 3e71a890e92658d48779f359ce8bf84b
|
2
|
+
// flow-typed version: cd4a902eba/jest_v24.x.x/flow_>=v0.39.x
|
3
|
+
|
4
|
+
type JestMockFn<TArguments: $ReadOnlyArray<*>, 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<TArguments>,
|
16
|
+
/**
|
17
|
+
* An array that contains all the object instances that have been
|
18
|
+
* instantiated from this mock function.
|
19
|
+
*/
|
20
|
+
instances: Array<TReturn>,
|
21
|
+
/**
|
22
|
+
* An array that contains all the object results that have been
|
23
|
+
* returned by this mock function call
|
24
|
+
*/
|
25
|
+
results: Array<{ isThrow: boolean, value: TReturn }>,
|
26
|
+
},
|
27
|
+
/**
|
28
|
+
* Resets all information stored in the mockFn.mock.calls and
|
29
|
+
* mockFn.mock.instances arrays. Often this is useful when you want to clean
|
30
|
+
* up a mock's usage data between two assertions.
|
31
|
+
*/
|
32
|
+
mockClear(): void,
|
33
|
+
/**
|
34
|
+
* Resets all information stored in the mock. This is useful when you want to
|
35
|
+
* completely restore a mock back to its initial state.
|
36
|
+
*/
|
37
|
+
mockReset(): void,
|
38
|
+
/**
|
39
|
+
* Removes the mock and restores the initial implementation. This is useful
|
40
|
+
* when you want to mock functions in certain test cases and restore the
|
41
|
+
* original implementation in others. Beware that mockFn.mockRestore only
|
42
|
+
* works when mock was created with jest.spyOn. Thus you have to take care of
|
43
|
+
* restoration yourself when manually assigning jest.fn().
|
44
|
+
*/
|
45
|
+
mockRestore(): void,
|
46
|
+
/**
|
47
|
+
* Accepts a function that should be used as the implementation of the mock.
|
48
|
+
* The mock itself will still record all calls that go into and instances
|
49
|
+
* that come from itself -- the only difference is that the implementation
|
50
|
+
* will also be executed when the mock is called.
|
51
|
+
*/
|
52
|
+
mockImplementation(
|
53
|
+
fn: (...args: TArguments) => TReturn
|
54
|
+
): JestMockFn<TArguments, TReturn>,
|
55
|
+
/**
|
56
|
+
* Accepts a function that will be used as an implementation of the mock for
|
57
|
+
* one call to the mocked function. Can be chained so that multiple function
|
58
|
+
* calls produce different results.
|
59
|
+
*/
|
60
|
+
mockImplementationOnce(
|
61
|
+
fn: (...args: TArguments) => TReturn
|
62
|
+
): JestMockFn<TArguments, TReturn>,
|
63
|
+
/**
|
64
|
+
* Accepts a string to use in test result output in place of "jest.fn()" to
|
65
|
+
* indicate which mock function is being referenced.
|
66
|
+
*/
|
67
|
+
mockName(name: string): JestMockFn<TArguments, TReturn>,
|
68
|
+
/**
|
69
|
+
* Just a simple sugar function for returning `this`
|
70
|
+
*/
|
71
|
+
mockReturnThis(): void,
|
72
|
+
/**
|
73
|
+
* Accepts a value that will be returned whenever the mock function is called.
|
74
|
+
*/
|
75
|
+
mockReturnValue(value: TReturn): JestMockFn<TArguments, TReturn>,
|
76
|
+
/**
|
77
|
+
* Sugar for only returning a value once inside your mock
|
78
|
+
*/
|
79
|
+
mockReturnValueOnce(value: TReturn): JestMockFn<TArguments, TReturn>,
|
80
|
+
/**
|
81
|
+
* Sugar for jest.fn().mockImplementation(() => Promise.resolve(value))
|
82
|
+
*/
|
83
|
+
mockResolvedValue(value: TReturn): JestMockFn<TArguments, Promise<TReturn>>,
|
84
|
+
/**
|
85
|
+
* Sugar for jest.fn().mockImplementationOnce(() => Promise.resolve(value))
|
86
|
+
*/
|
87
|
+
mockResolvedValueOnce(
|
88
|
+
value: TReturn
|
89
|
+
): JestMockFn<TArguments, Promise<TReturn>>,
|
90
|
+
/**
|
91
|
+
* Sugar for jest.fn().mockImplementation(() => Promise.reject(value))
|
92
|
+
*/
|
93
|
+
mockRejectedValue(value: TReturn): JestMockFn<TArguments, Promise<any>>,
|
94
|
+
/**
|
95
|
+
* Sugar for jest.fn().mockImplementationOnce(() => Promise.reject(value))
|
96
|
+
*/
|
97
|
+
mockRejectedValueOnce(value: TReturn): JestMockFn<TArguments, Promise<any>>,
|
98
|
+
};
|
99
|
+
|
100
|
+
type JestAsymmetricEqualityType = {
|
101
|
+
/**
|
102
|
+
* A custom Jasmine equality tester
|
103
|
+
*/
|
104
|
+
asymmetricMatch(value: mixed): boolean,
|
105
|
+
};
|
106
|
+
|
107
|
+
type JestCallsType = {
|
108
|
+
allArgs(): mixed,
|
109
|
+
all(): mixed,
|
110
|
+
any(): boolean,
|
111
|
+
count(): number,
|
112
|
+
first(): mixed,
|
113
|
+
mostRecent(): mixed,
|
114
|
+
reset(): void,
|
115
|
+
};
|
116
|
+
|
117
|
+
type JestClockType = {
|
118
|
+
install(): void,
|
119
|
+
mockDate(date: Date): void,
|
120
|
+
tick(milliseconds?: number): void,
|
121
|
+
uninstall(): void,
|
122
|
+
};
|
123
|
+
|
124
|
+
type JestMatcherResult = {
|
125
|
+
message?: string | (() => string),
|
126
|
+
pass: boolean,
|
127
|
+
};
|
128
|
+
|
129
|
+
type JestMatcher = (
|
130
|
+
received: any,
|
131
|
+
...actual: Array<any>
|
132
|
+
) => JestMatcherResult | Promise<JestMatcherResult>;
|
133
|
+
|
134
|
+
type JestPromiseType = {
|
135
|
+
/**
|
136
|
+
* Use rejects to unwrap the reason of a rejected promise so any other
|
137
|
+
* matcher can be chained. If the promise is fulfilled the assertion fails.
|
138
|
+
*/
|
139
|
+
rejects: JestExpectType,
|
140
|
+
/**
|
141
|
+
* Use resolves to unwrap the value of a fulfilled promise so any other
|
142
|
+
* matcher can be chained. If the promise is rejected the assertion fails.
|
143
|
+
*/
|
144
|
+
resolves: JestExpectType,
|
145
|
+
};
|
146
|
+
|
147
|
+
/**
|
148
|
+
* Jest allows functions and classes to be used as test names in test() and
|
149
|
+
* describe()
|
150
|
+
*/
|
151
|
+
type JestTestName = string | Function;
|
152
|
+
|
153
|
+
/**
|
154
|
+
* Plugin: jest-styled-components
|
155
|
+
*/
|
156
|
+
|
157
|
+
type JestStyledComponentsMatcherValue =
|
158
|
+
| string
|
159
|
+
| JestAsymmetricEqualityType
|
160
|
+
| RegExp
|
161
|
+
| typeof undefined;
|
162
|
+
|
163
|
+
type JestStyledComponentsMatcherOptions = {
|
164
|
+
media?: string,
|
165
|
+
modifier?: string,
|
166
|
+
supports?: string,
|
167
|
+
};
|
168
|
+
|
169
|
+
type JestStyledComponentsMatchersType = {
|
170
|
+
toHaveStyleRule(
|
171
|
+
property: string,
|
172
|
+
value: JestStyledComponentsMatcherValue,
|
173
|
+
options?: JestStyledComponentsMatcherOptions
|
174
|
+
): void,
|
175
|
+
};
|
176
|
+
|
177
|
+
/**
|
178
|
+
* Plugin: jest-enzyme
|
179
|
+
*/
|
180
|
+
type EnzymeMatchersType = {
|
181
|
+
// 5.x
|
182
|
+
toBeEmpty(): void,
|
183
|
+
toBePresent(): void,
|
184
|
+
// 6.x
|
185
|
+
toBeChecked(): void,
|
186
|
+
toBeDisabled(): void,
|
187
|
+
toBeEmptyRender(): void,
|
188
|
+
toContainMatchingElement(selector: string): void,
|
189
|
+
toContainMatchingElements(n: number, selector: string): void,
|
190
|
+
toContainExactlyOneMatchingElement(selector: string): void,
|
191
|
+
toContainReact(element: React$Element<any>): void,
|
192
|
+
toExist(): void,
|
193
|
+
toHaveClassName(className: string): void,
|
194
|
+
toHaveHTML(html: string): void,
|
195
|
+
toHaveProp: ((propKey: string, propValue?: any) => void) &
|
196
|
+
((props: {}) => void),
|
197
|
+
toHaveRef(refName: string): void,
|
198
|
+
toHaveState: ((stateKey: string, stateValue?: any) => void) &
|
199
|
+
((state: {}) => void),
|
200
|
+
toHaveStyle: ((styleKey: string, styleValue?: any) => void) &
|
201
|
+
((style: {}) => void),
|
202
|
+
toHaveTagName(tagName: string): void,
|
203
|
+
toHaveText(text: string): void,
|
204
|
+
toHaveValue(value: any): void,
|
205
|
+
toIncludeText(text: string): void,
|
206
|
+
toMatchElement(
|
207
|
+
element: React$Element<any>,
|
208
|
+
options?: {| ignoreProps?: boolean, verbose?: boolean |}
|
209
|
+
): void,
|
210
|
+
toMatchSelector(selector: string): void,
|
211
|
+
// 7.x
|
212
|
+
toHaveDisplayName(name: string): void,
|
213
|
+
};
|
214
|
+
|
215
|
+
// DOM testing library extensions (jest-dom)
|
216
|
+
// https://github.com/testing-library/jest-dom
|
217
|
+
type DomTestingLibraryType = {
|
218
|
+
/**
|
219
|
+
* @deprecated
|
220
|
+
*/
|
221
|
+
toBeInTheDOM(container?: HTMLElement): void,
|
222
|
+
|
223
|
+
toBeInTheDocument(): void,
|
224
|
+
toBeVisible(): void,
|
225
|
+
toBeEmpty(): void,
|
226
|
+
toBeDisabled(): void,
|
227
|
+
toBeEnabled(): void,
|
228
|
+
toBeInvalid(): void,
|
229
|
+
toBeRequired(): void,
|
230
|
+
toBeValid(): void,
|
231
|
+
toContainElement(element: HTMLElement | null): void,
|
232
|
+
toContainHTML(htmlText: string): void,
|
233
|
+
toHaveAttribute(attr: string, value?: any): void,
|
234
|
+
toHaveClass(...classNames: string[]): void,
|
235
|
+
toHaveFocus(): void,
|
236
|
+
toHaveFormValues(expectedValues: { [name: string]: any }): void,
|
237
|
+
toHaveStyle(css: string): void,
|
238
|
+
toHaveTextContent(
|
239
|
+
text: string | RegExp,
|
240
|
+
options?: { normalizeWhitespace: boolean }
|
241
|
+
): void,
|
242
|
+
toHaveValue(value?: string | string[] | number): void,
|
243
|
+
};
|
244
|
+
|
245
|
+
// Jest JQuery Matchers: https://github.com/unindented/custom-jquery-matchers
|
246
|
+
type JestJQueryMatchersType = {
|
247
|
+
toExist(): void,
|
248
|
+
toHaveLength(len: number): void,
|
249
|
+
toHaveId(id: string): void,
|
250
|
+
toHaveClass(className: string): void,
|
251
|
+
toHaveTag(tag: string): void,
|
252
|
+
toHaveAttr(key: string, val?: any): void,
|
253
|
+
toHaveProp(key: string, val?: any): void,
|
254
|
+
toHaveText(text: string | RegExp): void,
|
255
|
+
toHaveData(key: string, val?: any): void,
|
256
|
+
toHaveValue(val: any): void,
|
257
|
+
toHaveCss(css: { [key: string]: any }): void,
|
258
|
+
toBeChecked(): void,
|
259
|
+
toBeDisabled(): void,
|
260
|
+
toBeEmpty(): void,
|
261
|
+
toBeHidden(): void,
|
262
|
+
toBeSelected(): void,
|
263
|
+
toBeVisible(): void,
|
264
|
+
toBeFocused(): void,
|
265
|
+
toBeInDom(): void,
|
266
|
+
toBeMatchedBy(sel: string): void,
|
267
|
+
toHaveDescendant(sel: string): void,
|
268
|
+
toHaveDescendantWithText(sel: string, text: string | RegExp): void,
|
269
|
+
};
|
270
|
+
|
271
|
+
// Jest Extended Matchers: https://github.com/jest-community/jest-extended
|
272
|
+
type JestExtendedMatchersType = {
|
273
|
+
/**
|
274
|
+
* Note: Currently unimplemented
|
275
|
+
* Passing assertion
|
276
|
+
*
|
277
|
+
* @param {String} message
|
278
|
+
*/
|
279
|
+
// pass(message: string): void;
|
280
|
+
|
281
|
+
/**
|
282
|
+
* Note: Currently unimplemented
|
283
|
+
* Failing assertion
|
284
|
+
*
|
285
|
+
* @param {String} message
|
286
|
+
*/
|
287
|
+
// fail(message: string): void;
|
288
|
+
|
289
|
+
/**
|
290
|
+
* Use .toBeEmpty when checking if a String '', Array [] or Object {} is empty.
|
291
|
+
*/
|
292
|
+
toBeEmpty(): void,
|
293
|
+
|
294
|
+
/**
|
295
|
+
* Use .toBeOneOf when checking if a value is a member of a given Array.
|
296
|
+
* @param {Array.<*>} members
|
297
|
+
*/
|
298
|
+
toBeOneOf(members: any[]): void,
|
299
|
+
|
300
|
+
/**
|
301
|
+
* Use `.toBeNil` when checking a value is `null` or `undefined`.
|
302
|
+
*/
|
303
|
+
toBeNil(): void,
|
304
|
+
|
305
|
+
/**
|
306
|
+
* Use `.toSatisfy` when you want to use a custom matcher by supplying a predicate function that returns a `Boolean`.
|
307
|
+
* @param {Function} predicate
|
308
|
+
*/
|
309
|
+
toSatisfy(predicate: (n: any) => boolean): void,
|
310
|
+
|
311
|
+
/**
|
312
|
+
* Use `.toBeArray` when checking if a value is an `Array`.
|
313
|
+
*/
|
314
|
+
toBeArray(): void,
|
315
|
+
|
316
|
+
/**
|
317
|
+
* Use `.toBeArrayOfSize` when checking if a value is an `Array` of size x.
|
318
|
+
* @param {Number} x
|
319
|
+
*/
|
320
|
+
toBeArrayOfSize(x: number): void,
|
321
|
+
|
322
|
+
/**
|
323
|
+
* Use `.toIncludeAllMembers` when checking if an `Array` contains all of the same members of a given set.
|
324
|
+
* @param {Array.<*>} members
|
325
|
+
*/
|
326
|
+
toIncludeAllMembers(members: any[]): void,
|
327
|
+
|
328
|
+
/**
|
329
|
+
* Use `.toIncludeAnyMembers` when checking if an `Array` contains any of the members of a given set.
|
330
|
+
* @param {Array.<*>} members
|
331
|
+
*/
|
332
|
+
toIncludeAnyMembers(members: any[]): void,
|
333
|
+
|
334
|
+
/**
|
335
|
+
* 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.
|
336
|
+
* @param {Function} predicate
|
337
|
+
*/
|
338
|
+
toSatisfyAll(predicate: (n: any) => boolean): void,
|
339
|
+
|
340
|
+
/**
|
341
|
+
* Use `.toBeBoolean` when checking if a value is a `Boolean`.
|
342
|
+
*/
|
343
|
+
toBeBoolean(): void,
|
344
|
+
|
345
|
+
/**
|
346
|
+
* Use `.toBeTrue` when checking a value is equal (===) to `true`.
|
347
|
+
*/
|
348
|
+
toBeTrue(): void,
|
349
|
+
|
350
|
+
/**
|
351
|
+
* Use `.toBeFalse` when checking a value is equal (===) to `false`.
|
352
|
+
*/
|
353
|
+
toBeFalse(): void,
|
354
|
+
|
355
|
+
/**
|
356
|
+
* Use .toBeDate when checking if a value is a Date.
|
357
|
+
*/
|
358
|
+
toBeDate(): void,
|
359
|
+
|
360
|
+
/**
|
361
|
+
* Use `.toBeFunction` when checking if a value is a `Function`.
|
362
|
+
*/
|
363
|
+
toBeFunction(): void,
|
364
|
+
|
365
|
+
/**
|
366
|
+
* Use `.toHaveBeenCalledBefore` when checking if a `Mock` was called before another `Mock`.
|
367
|
+
*
|
368
|
+
* Note: Required Jest version >22
|
369
|
+
* 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
|
370
|
+
*
|
371
|
+
* @param {Mock} mock
|
372
|
+
*/
|
373
|
+
toHaveBeenCalledBefore(mock: JestMockFn<any, any>): void,
|
374
|
+
|
375
|
+
/**
|
376
|
+
* Use `.toBeNumber` when checking if a value is a `Number`.
|
377
|
+
*/
|
378
|
+
toBeNumber(): void,
|
379
|
+
|
380
|
+
/**
|
381
|
+
* Use `.toBeNaN` when checking a value is `NaN`.
|
382
|
+
*/
|
383
|
+
toBeNaN(): void,
|
384
|
+
|
385
|
+
/**
|
386
|
+
* Use `.toBeFinite` when checking if a value is a `Number`, not `NaN` or `Infinity`.
|
387
|
+
*/
|
388
|
+
toBeFinite(): void,
|
389
|
+
|
390
|
+
/**
|
391
|
+
* Use `.toBePositive` when checking if a value is a positive `Number`.
|
392
|
+
*/
|
393
|
+
toBePositive(): void,
|
394
|
+
|
395
|
+
/**
|
396
|
+
* Use `.toBeNegative` when checking if a value is a negative `Number`.
|
397
|
+
*/
|
398
|
+
toBeNegative(): void,
|
399
|
+
|
400
|
+
/**
|
401
|
+
* Use `.toBeEven` when checking if a value is an even `Number`.
|
402
|
+
*/
|
403
|
+
toBeEven(): void,
|
404
|
+
|
405
|
+
/**
|
406
|
+
* Use `.toBeOdd` when checking if a value is an odd `Number`.
|
407
|
+
*/
|
408
|
+
toBeOdd(): void,
|
409
|
+
|
410
|
+
/**
|
411
|
+
* Use `.toBeWithin` when checking if a number is in between the given bounds of: start (inclusive) and end (exclusive).
|
412
|
+
*
|
413
|
+
* @param {Number} start
|
414
|
+
* @param {Number} end
|
415
|
+
*/
|
416
|
+
toBeWithin(start: number, end: number): void,
|
417
|
+
|
418
|
+
/**
|
419
|
+
* Use `.toBeObject` when checking if a value is an `Object`.
|
420
|
+
*/
|
421
|
+
toBeObject(): void,
|
422
|
+
|
423
|
+
/**
|
424
|
+
* Use `.toContainKey` when checking if an object contains the provided key.
|
425
|
+
*
|
426
|
+
* @param {String} key
|
427
|
+
*/
|
428
|
+
toContainKey(key: string): void,
|
429
|
+
|
430
|
+
/**
|
431
|
+
* Use `.toContainKeys` when checking if an object has all of the provided keys.
|
432
|
+
*
|
433
|
+
* @param {Array.<String>} keys
|
434
|
+
*/
|
435
|
+
toContainKeys(keys: string[]): void,
|
436
|
+
|
437
|
+
/**
|
438
|
+
* Use `.toContainAllKeys` when checking if an object only contains all of the provided keys.
|
439
|
+
*
|
440
|
+
* @param {Array.<String>} keys
|
441
|
+
*/
|
442
|
+
toContainAllKeys(keys: string[]): void,
|
443
|
+
|
444
|
+
/**
|
445
|
+
* Use `.toContainAnyKeys` when checking if an object contains at least one of the provided keys.
|
446
|
+
*
|
447
|
+
* @param {Array.<String>} keys
|
448
|
+
*/
|
449
|
+
toContainAnyKeys(keys: string[]): void,
|
450
|
+
|
451
|
+
/**
|
452
|
+
* Use `.toContainValue` when checking if an object contains the provided value.
|
453
|
+
*
|
454
|
+
* @param {*} value
|
455
|
+
*/
|
456
|
+
toContainValue(value: any): void,
|
457
|
+
|
458
|
+
/**
|
459
|
+
* Use `.toContainValues` when checking if an object contains all of the provided values.
|
460
|
+
*
|
461
|
+
* @param {Array.<*>} values
|
462
|
+
*/
|
463
|
+
toContainValues(values: any[]): void,
|
464
|
+
|
465
|
+
/**
|
466
|
+
* Use `.toContainAllValues` when checking if an object only contains all of the provided values.
|
467
|
+
*
|
468
|
+
* @param {Array.<*>} values
|
469
|
+
*/
|
470
|
+
toContainAllValues(values: any[]): void,
|
471
|
+
|
472
|
+
/**
|
473
|
+
* Use `.toContainAnyValues` when checking if an object contains at least one of the provided values.
|
474
|
+
*
|
475
|
+
* @param {Array.<*>} values
|
476
|
+
*/
|
477
|
+
toContainAnyValues(values: any[]): void,
|
478
|
+
|
479
|
+
/**
|
480
|
+
* Use `.toContainEntry` when checking if an object contains the provided entry.
|
481
|
+
*
|
482
|
+
* @param {Array.<String, String>} entry
|
483
|
+
*/
|
484
|
+
toContainEntry(entry: [string, string]): void,
|
485
|
+
|
486
|
+
/**
|
487
|
+
* Use `.toContainEntries` when checking if an object contains all of the provided entries.
|
488
|
+
*
|
489
|
+
* @param {Array.<Array.<String, String>>} entries
|
490
|
+
*/
|
491
|
+
toContainEntries(entries: [string, string][]): void,
|
492
|
+
|
493
|
+
/**
|
494
|
+
* Use `.toContainAllEntries` when checking if an object only contains all of the provided entries.
|
495
|
+
*
|
496
|
+
* @param {Array.<Array.<String, String>>} entries
|
497
|
+
*/
|
498
|
+
toContainAllEntries(entries: [string, string][]): void,
|
499
|
+
|
500
|
+
/**
|
501
|
+
* Use `.toContainAnyEntries` when checking if an object contains at least one of the provided entries.
|
502
|
+
*
|
503
|
+
* @param {Array.<Array.<String, String>>} entries
|
504
|
+
*/
|
505
|
+
toContainAnyEntries(entries: [string, string][]): void,
|
506
|
+
|
507
|
+
/**
|
508
|
+
* Use `.toBeExtensible` when checking if an object is extensible.
|
509
|
+
*/
|
510
|
+
toBeExtensible(): void,
|
511
|
+
|
512
|
+
/**
|
513
|
+
* Use `.toBeFrozen` when checking if an object is frozen.
|
514
|
+
*/
|
515
|
+
toBeFrozen(): void,
|
516
|
+
|
517
|
+
/**
|
518
|
+
* Use `.toBeSealed` when checking if an object is sealed.
|
519
|
+
*/
|
520
|
+
toBeSealed(): void,
|
521
|
+
|
522
|
+
/**
|
523
|
+
* Use `.toBeString` when checking if a value is a `String`.
|
524
|
+
*/
|
525
|
+
toBeString(): void,
|
526
|
+
|
527
|
+
/**
|
528
|
+
* Use `.toEqualCaseInsensitive` when checking if a string is equal (===) to another ignoring the casing of both strings.
|
529
|
+
*
|
530
|
+
* @param {String} string
|
531
|
+
*/
|
532
|
+
toEqualCaseInsensitive(string: string): void,
|
533
|
+
|
534
|
+
/**
|
535
|
+
* Use `.toStartWith` when checking if a `String` starts with a given `String` prefix.
|
536
|
+
*
|
537
|
+
* @param {String} prefix
|
538
|
+
*/
|
539
|
+
toStartWith(prefix: string): void,
|
540
|
+
|
541
|
+
/**
|
542
|
+
* Use `.toEndWith` when checking if a `String` ends with a given `String` suffix.
|
543
|
+
*
|
544
|
+
* @param {String} suffix
|
545
|
+
*/
|
546
|
+
toEndWith(suffix: string): void,
|
547
|
+
|
548
|
+
/**
|
549
|
+
* Use `.toInclude` when checking if a `String` includes the given `String` substring.
|
550
|
+
*
|
551
|
+
* @param {String} substring
|
552
|
+
*/
|
553
|
+
toInclude(substring: string): void,
|
554
|
+
|
555
|
+
/**
|
556
|
+
* Use `.toIncludeRepeated` when checking if a `String` includes the given `String` substring the correct number of times.
|
557
|
+
*
|
558
|
+
* @param {String} substring
|
559
|
+
* @param {Number} times
|
560
|
+
*/
|
561
|
+
toIncludeRepeated(substring: string, times: number): void,
|
562
|
+
|
563
|
+
/**
|
564
|
+
* Use `.toIncludeMultiple` when checking if a `String` includes all of the given substrings.
|
565
|
+
*
|
566
|
+
* @param {Array.<String>} substring
|
567
|
+
*/
|
568
|
+
toIncludeMultiple(substring: string[]): void,
|
569
|
+
};
|
570
|
+
|
571
|
+
interface JestExpectType {
|
572
|
+
not: JestExpectType &
|
573
|
+
EnzymeMatchersType &
|
574
|
+
DomTestingLibraryType &
|
575
|
+
JestJQueryMatchersType &
|
576
|
+
JestStyledComponentsMatchersType &
|
577
|
+
JestExtendedMatchersType;
|
578
|
+
/**
|
579
|
+
* If you have a mock function, you can use .lastCalledWith to test what
|
580
|
+
* arguments it was last called with.
|
581
|
+
*/
|
582
|
+
lastCalledWith(...args: Array<any>): void;
|
583
|
+
/**
|
584
|
+
* toBe just checks that a value is what you expect. It uses === to check
|
585
|
+
* strict equality.
|
586
|
+
*/
|
587
|
+
toBe(value: any): void;
|
588
|
+
/**
|
589
|
+
* Use .toBeCalledWith to ensure that a mock function was called with
|
590
|
+
* specific arguments.
|
591
|
+
*/
|
592
|
+
toBeCalledWith(...args: Array<any>): void;
|
593
|
+
/**
|
594
|
+
* Using exact equality with floating point numbers is a bad idea. Rounding
|
595
|
+
* means that intuitive things fail.
|
596
|
+
*/
|
597
|
+
toBeCloseTo(num: number, delta: any): void;
|
598
|
+
/**
|
599
|
+
* Use .toBeDefined to check that a variable is not undefined.
|
600
|
+
*/
|
601
|
+
toBeDefined(): void;
|
602
|
+
/**
|
603
|
+
* Use .toBeFalsy when you don't care what a value is, you just want to
|
604
|
+
* ensure a value is false in a boolean context.
|
605
|
+
*/
|
606
|
+
toBeFalsy(): void;
|
607
|
+
/**
|
608
|
+
* To compare floating point numbers, you can use toBeGreaterThan.
|
609
|
+
*/
|
610
|
+
toBeGreaterThan(number: number): void;
|
611
|
+
/**
|
612
|
+
* To compare floating point numbers, you can use toBeGreaterThanOrEqual.
|
613
|
+
*/
|
614
|
+
toBeGreaterThanOrEqual(number: number): void;
|
615
|
+
/**
|
616
|
+
* To compare floating point numbers, you can use toBeLessThan.
|
617
|
+
*/
|
618
|
+
toBeLessThan(number: number): void;
|
619
|
+
/**
|
620
|
+
* To compare floating point numbers, you can use toBeLessThanOrEqual.
|
621
|
+
*/
|
622
|
+
toBeLessThanOrEqual(number: number): void;
|
623
|
+
/**
|
624
|
+
* Use .toBeInstanceOf(Class) to check that an object is an instance of a
|
625
|
+
* class.
|
626
|
+
*/
|
627
|
+
toBeInstanceOf(cls: Class<*>): void;
|
628
|
+
/**
|
629
|
+
* .toBeNull() is the same as .toBe(null) but the error messages are a bit
|
630
|
+
* nicer.
|
631
|
+
*/
|
632
|
+
toBeNull(): void;
|
633
|
+
/**
|
634
|
+
* Use .toBeTruthy when you don't care what a value is, you just want to
|
635
|
+
* ensure a value is true in a boolean context.
|
636
|
+
*/
|
637
|
+
toBeTruthy(): void;
|
638
|
+
/**
|
639
|
+
* Use .toBeUndefined to check that a variable is undefined.
|
640
|
+
*/
|
641
|
+
toBeUndefined(): void;
|
642
|
+
/**
|
643
|
+
* Use .toContain when you want to check that an item is in a list. For
|
644
|
+
* testing the items in the list, this uses ===, a strict equality check.
|
645
|
+
*/
|
646
|
+
toContain(item: any): void;
|
647
|
+
/**
|
648
|
+
* Use .toContainEqual when you want to check that an item is in a list. For
|
649
|
+
* testing the items in the list, this matcher recursively checks the
|
650
|
+
* equality of all fields, rather than checking for object identity.
|
651
|
+
*/
|
652
|
+
toContainEqual(item: any): void;
|
653
|
+
/**
|
654
|
+
* Use .toEqual when you want to check that two objects have the same value.
|
655
|
+
* This matcher recursively checks the equality of all fields, rather than
|
656
|
+
* checking for object identity.
|
657
|
+
*/
|
658
|
+
toEqual(value: any): void;
|
659
|
+
/**
|
660
|
+
* Use .toHaveBeenCalled to ensure that a mock function got called.
|
661
|
+
*/
|
662
|
+
toHaveBeenCalled(): void;
|
663
|
+
toBeCalled(): void;
|
664
|
+
/**
|
665
|
+
* Use .toHaveBeenCalledTimes to ensure that a mock function got called exact
|
666
|
+
* number of times.
|
667
|
+
*/
|
668
|
+
toHaveBeenCalledTimes(number: number): void;
|
669
|
+
toBeCalledTimes(number: number): void;
|
670
|
+
/**
|
671
|
+
*
|
672
|
+
*/
|
673
|
+
toHaveBeenNthCalledWith(nthCall: number, ...args: Array<any>): void;
|
674
|
+
nthCalledWith(nthCall: number, ...args: Array<any>): void;
|
675
|
+
/**
|
676
|
+
*
|
677
|
+
*/
|
678
|
+
toHaveReturned(): void;
|
679
|
+
toReturn(): void;
|
680
|
+
/**
|
681
|
+
*
|
682
|
+
*/
|
683
|
+
toHaveReturnedTimes(number: number): void;
|
684
|
+
toReturnTimes(number: number): void;
|
685
|
+
/**
|
686
|
+
*
|
687
|
+
*/
|
688
|
+
toHaveReturnedWith(value: any): void;
|
689
|
+
toReturnWith(value: any): void;
|
690
|
+
/**
|
691
|
+
*
|
692
|
+
*/
|
693
|
+
toHaveLastReturnedWith(value: any): void;
|
694
|
+
lastReturnedWith(value: any): void;
|
695
|
+
/**
|
696
|
+
*
|
697
|
+
*/
|
698
|
+
toHaveNthReturnedWith(nthCall: number, value: any): void;
|
699
|
+
nthReturnedWith(nthCall: number, value: any): void;
|
700
|
+
/**
|
701
|
+
* Use .toHaveBeenCalledWith to ensure that a mock function was called with
|
702
|
+
* specific arguments.
|
703
|
+
*/
|
704
|
+
toHaveBeenCalledWith(...args: Array<any>): void;
|
705
|
+
toBeCalledWith(...args: Array<any>): void;
|
706
|
+
/**
|
707
|
+
* Use .toHaveBeenLastCalledWith to ensure that a mock function was last called
|
708
|
+
* with specific arguments.
|
709
|
+
*/
|
710
|
+
toHaveBeenLastCalledWith(...args: Array<any>): void;
|
711
|
+
lastCalledWith(...args: Array<any>): void;
|
712
|
+
/**
|
713
|
+
* Check that an object has a .length property and it is set to a certain
|
714
|
+
* numeric value.
|
715
|
+
*/
|
716
|
+
toHaveLength(number: number): void;
|
717
|
+
/**
|
718
|
+
*
|
719
|
+
*/
|
720
|
+
toHaveProperty(propPath: string | $ReadOnlyArray<string>, value?: any): void;
|
721
|
+
/**
|
722
|
+
* Use .toMatch to check that a string matches a regular expression or string.
|
723
|
+
*/
|
724
|
+
toMatch(regexpOrString: RegExp | string): void;
|
725
|
+
/**
|
726
|
+
* Use .toMatchObject to check that a javascript object matches a subset of the properties of an object.
|
727
|
+
*/
|
728
|
+
toMatchObject(object: Object | Array<Object>): void;
|
729
|
+
/**
|
730
|
+
* Use .toStrictEqual to check that a javascript object matches a subset of the properties of an object.
|
731
|
+
*/
|
732
|
+
toStrictEqual(value: any): void;
|
733
|
+
/**
|
734
|
+
* This ensures that an Object matches the most recent snapshot.
|
735
|
+
*/
|
736
|
+
toMatchSnapshot(propertyMatchers?: any, name?: string): void;
|
737
|
+
/**
|
738
|
+
* This ensures that an Object matches the most recent snapshot.
|
739
|
+
*/
|
740
|
+
toMatchSnapshot(name: string): void;
|
741
|
+
|
742
|
+
toMatchInlineSnapshot(snapshot?: string): void;
|
743
|
+
toMatchInlineSnapshot(propertyMatchers?: any, snapshot?: string): void;
|
744
|
+
/**
|
745
|
+
* Use .toThrow to test that a function throws when it is called.
|
746
|
+
* If you want to test that a specific error gets thrown, you can provide an
|
747
|
+
* argument to toThrow. The argument can be a string for the error message,
|
748
|
+
* a class for the error, or a regex that should match the error.
|
749
|
+
*
|
750
|
+
* Alias: .toThrowError
|
751
|
+
*/
|
752
|
+
toThrow(message?: string | Error | Class<Error> | RegExp): void;
|
753
|
+
toThrowError(message?: string | Error | Class<Error> | RegExp): void;
|
754
|
+
/**
|
755
|
+
* Use .toThrowErrorMatchingSnapshot to test that a function throws a error
|
756
|
+
* matching the most recent snapshot when it is called.
|
757
|
+
*/
|
758
|
+
toThrowErrorMatchingSnapshot(): void;
|
759
|
+
toThrowErrorMatchingInlineSnapshot(snapshot?: string): void;
|
760
|
+
}
|
761
|
+
|
762
|
+
type JestObjectType = {
|
763
|
+
/**
|
764
|
+
* Disables automatic mocking in the module loader.
|
765
|
+
*
|
766
|
+
* After this method is called, all `require()`s will return the real
|
767
|
+
* versions of each module (rather than a mocked version).
|
768
|
+
*/
|
769
|
+
disableAutomock(): JestObjectType,
|
770
|
+
/**
|
771
|
+
* An un-hoisted version of disableAutomock
|
772
|
+
*/
|
773
|
+
autoMockOff(): JestObjectType,
|
774
|
+
/**
|
775
|
+
* Enables automatic mocking in the module loader.
|
776
|
+
*/
|
777
|
+
enableAutomock(): JestObjectType,
|
778
|
+
/**
|
779
|
+
* An un-hoisted version of enableAutomock
|
780
|
+
*/
|
781
|
+
autoMockOn(): JestObjectType,
|
782
|
+
/**
|
783
|
+
* Clears the mock.calls and mock.instances properties of all mocks.
|
784
|
+
* Equivalent to calling .mockClear() on every mocked function.
|
785
|
+
*/
|
786
|
+
clearAllMocks(): JestObjectType,
|
787
|
+
/**
|
788
|
+
* Resets the state of all mocks. Equivalent to calling .mockReset() on every
|
789
|
+
* mocked function.
|
790
|
+
*/
|
791
|
+
resetAllMocks(): JestObjectType,
|
792
|
+
/**
|
793
|
+
* Restores all mocks back to their original value.
|
794
|
+
*/
|
795
|
+
restoreAllMocks(): JestObjectType,
|
796
|
+
/**
|
797
|
+
* Removes any pending timers from the timer system.
|
798
|
+
*/
|
799
|
+
clearAllTimers(): void,
|
800
|
+
/**
|
801
|
+
* Returns the number of fake timers still left to run.
|
802
|
+
*/
|
803
|
+
getTimerCount(): number,
|
804
|
+
/**
|
805
|
+
* The same as `mock` but not moved to the top of the expectation by
|
806
|
+
* babel-jest.
|
807
|
+
*/
|
808
|
+
doMock(moduleName: string, moduleFactory?: any): JestObjectType,
|
809
|
+
/**
|
810
|
+
* The same as `unmock` but not moved to the top of the expectation by
|
811
|
+
* babel-jest.
|
812
|
+
*/
|
813
|
+
dontMock(moduleName: string): JestObjectType,
|
814
|
+
/**
|
815
|
+
* Returns a new, unused mock function. Optionally takes a mock
|
816
|
+
* implementation.
|
817
|
+
*/
|
818
|
+
fn<TArguments: $ReadOnlyArray<*>, TReturn>(
|
819
|
+
implementation?: (...args: TArguments) => TReturn
|
820
|
+
): JestMockFn<TArguments, TReturn>,
|
821
|
+
/**
|
822
|
+
* Determines if the given function is a mocked function.
|
823
|
+
*/
|
824
|
+
isMockFunction(fn: Function): boolean,
|
825
|
+
/**
|
826
|
+
* Given the name of a module, use the automatic mocking system to generate a
|
827
|
+
* mocked version of the module for you.
|
828
|
+
*/
|
829
|
+
genMockFromModule(moduleName: string): any,
|
830
|
+
/**
|
831
|
+
* Mocks a module with an auto-mocked version when it is being required.
|
832
|
+
*
|
833
|
+
* The second argument can be used to specify an explicit module factory that
|
834
|
+
* is being run instead of using Jest's automocking feature.
|
835
|
+
*
|
836
|
+
* The third argument can be used to create virtual mocks -- mocks of modules
|
837
|
+
* that don't exist anywhere in the system.
|
838
|
+
*/
|
839
|
+
mock(
|
840
|
+
moduleName: string,
|
841
|
+
moduleFactory?: any,
|
842
|
+
options?: Object
|
843
|
+
): JestObjectType,
|
844
|
+
/**
|
845
|
+
* Returns the actual module instead of a mock, bypassing all checks on
|
846
|
+
* whether the module should receive a mock implementation or not.
|
847
|
+
*/
|
848
|
+
requireActual(moduleName: string): any,
|
849
|
+
/**
|
850
|
+
* Returns a mock module instead of the actual module, bypassing all checks
|
851
|
+
* on whether the module should be required normally or not.
|
852
|
+
*/
|
853
|
+
requireMock(moduleName: string): any,
|
854
|
+
/**
|
855
|
+
* Resets the module registry - the cache of all required modules. This is
|
856
|
+
* useful to isolate modules where local state might conflict between tests.
|
857
|
+
*/
|
858
|
+
resetModules(): JestObjectType,
|
859
|
+
|
860
|
+
/**
|
861
|
+
* Creates a sandbox registry for the modules that are loaded inside the
|
862
|
+
* callback function. This is useful to isolate specific modules for every
|
863
|
+
* test so that local module state doesn't conflict between tests.
|
864
|
+
*/
|
865
|
+
isolateModules(fn: () => void): JestObjectType,
|
866
|
+
|
867
|
+
/**
|
868
|
+
* Exhausts the micro-task queue (usually interfaced in node via
|
869
|
+
* process.nextTick).
|
870
|
+
*/
|
871
|
+
runAllTicks(): void,
|
872
|
+
/**
|
873
|
+
* Exhausts the macro-task queue (i.e., all tasks queued by setTimeout(),
|
874
|
+
* setInterval(), and setImmediate()).
|
875
|
+
*/
|
876
|
+
runAllTimers(): void,
|
877
|
+
/**
|
878
|
+
* Exhausts all tasks queued by setImmediate().
|
879
|
+
*/
|
880
|
+
runAllImmediates(): void,
|
881
|
+
/**
|
882
|
+
* Executes only the macro task queue (i.e. all tasks queued by setTimeout()
|
883
|
+
* or setInterval() and setImmediate()).
|
884
|
+
*/
|
885
|
+
advanceTimersByTime(msToRun: number): void,
|
886
|
+
/**
|
887
|
+
* Executes only the macro task queue (i.e. all tasks queued by setTimeout()
|
888
|
+
* or setInterval() and setImmediate()).
|
889
|
+
*
|
890
|
+
* Renamed to `advanceTimersByTime`.
|
891
|
+
*/
|
892
|
+
runTimersToTime(msToRun: number): void,
|
893
|
+
/**
|
894
|
+
* Executes only the macro-tasks that are currently pending (i.e., only the
|
895
|
+
* tasks that have been queued by setTimeout() or setInterval() up to this
|
896
|
+
* point)
|
897
|
+
*/
|
898
|
+
runOnlyPendingTimers(): void,
|
899
|
+
/**
|
900
|
+
* Explicitly supplies the mock object that the module system should return
|
901
|
+
* for the specified module. Note: It is recommended to use jest.mock()
|
902
|
+
* instead.
|
903
|
+
*/
|
904
|
+
setMock(moduleName: string, moduleExports: any): JestObjectType,
|
905
|
+
/**
|
906
|
+
* Indicates that the module system should never return a mocked version of
|
907
|
+
* the specified module from require() (e.g. that it should always return the
|
908
|
+
* real module).
|
909
|
+
*/
|
910
|
+
unmock(moduleName: string): JestObjectType,
|
911
|
+
/**
|
912
|
+
* Instructs Jest to use fake versions of the standard timer functions
|
913
|
+
* (setTimeout, setInterval, clearTimeout, clearInterval, nextTick,
|
914
|
+
* setImmediate and clearImmediate).
|
915
|
+
*/
|
916
|
+
useFakeTimers(): JestObjectType,
|
917
|
+
/**
|
918
|
+
* Instructs Jest to use the real versions of the standard timer functions.
|
919
|
+
*/
|
920
|
+
useRealTimers(): JestObjectType,
|
921
|
+
/**
|
922
|
+
* Creates a mock function similar to jest.fn but also tracks calls to
|
923
|
+
* object[methodName].
|
924
|
+
*/
|
925
|
+
spyOn(
|
926
|
+
object: Object,
|
927
|
+
methodName: string,
|
928
|
+
accessType?: 'get' | 'set'
|
929
|
+
): JestMockFn<any, any>,
|
930
|
+
/**
|
931
|
+
* Set the default timeout interval for tests and before/after hooks in milliseconds.
|
932
|
+
* Note: The default timeout interval is 5 seconds if this method is not called.
|
933
|
+
*/
|
934
|
+
setTimeout(timeout: number): JestObjectType,
|
935
|
+
};
|
936
|
+
|
937
|
+
type JestSpyType = {
|
938
|
+
calls: JestCallsType,
|
939
|
+
};
|
940
|
+
|
941
|
+
type JestDoneFn = {
|
942
|
+
(): void,
|
943
|
+
fail: (error: Error) => void,
|
944
|
+
};
|
945
|
+
|
946
|
+
/** Runs this function after every test inside this context */
|
947
|
+
declare function afterEach(
|
948
|
+
fn: (done: JestDoneFn) => ?Promise<mixed>,
|
949
|
+
timeout?: number
|
950
|
+
): void;
|
951
|
+
/** Runs this function before every test inside this context */
|
952
|
+
declare function beforeEach(
|
953
|
+
fn: (done: JestDoneFn) => ?Promise<mixed>,
|
954
|
+
timeout?: number
|
955
|
+
): void;
|
956
|
+
/** Runs this function after all tests have finished inside this context */
|
957
|
+
declare function afterAll(
|
958
|
+
fn: (done: JestDoneFn) => ?Promise<mixed>,
|
959
|
+
timeout?: number
|
960
|
+
): void;
|
961
|
+
/** Runs this function before any tests have started inside this context */
|
962
|
+
declare function beforeAll(
|
963
|
+
fn: (done: JestDoneFn) => ?Promise<mixed>,
|
964
|
+
timeout?: number
|
965
|
+
): void;
|
966
|
+
|
967
|
+
/** A context for grouping tests together */
|
968
|
+
declare var describe: {
|
969
|
+
/**
|
970
|
+
* Creates a block that groups together several related tests in one "test suite"
|
971
|
+
*/
|
972
|
+
(name: JestTestName, fn: () => void): void,
|
973
|
+
|
974
|
+
/**
|
975
|
+
* Only run this describe block
|
976
|
+
*/
|
977
|
+
only(name: JestTestName, fn: () => void): void,
|
978
|
+
|
979
|
+
/**
|
980
|
+
* Skip running this describe block
|
981
|
+
*/
|
982
|
+
skip(name: JestTestName, fn: () => void): void,
|
983
|
+
|
984
|
+
/**
|
985
|
+
* each runs this test against array of argument arrays per each run
|
986
|
+
*
|
987
|
+
* @param {table} table of Test
|
988
|
+
*/
|
989
|
+
each(
|
990
|
+
...table: Array<Array<mixed> | mixed> | [Array<string>, string]
|
991
|
+
): (
|
992
|
+
name: JestTestName,
|
993
|
+
fn?: (...args: Array<any>) => ?Promise<mixed>,
|
994
|
+
timeout?: number
|
995
|
+
) => void,
|
996
|
+
};
|
997
|
+
|
998
|
+
/** An individual test unit */
|
999
|
+
declare var it: {
|
1000
|
+
/**
|
1001
|
+
* An individual test unit
|
1002
|
+
*
|
1003
|
+
* @param {JestTestName} Name of Test
|
1004
|
+
* @param {Function} Test
|
1005
|
+
* @param {number} Timeout for the test, in milliseconds.
|
1006
|
+
*/
|
1007
|
+
(
|
1008
|
+
name: JestTestName,
|
1009
|
+
fn?: (done: JestDoneFn) => ?Promise<mixed>,
|
1010
|
+
timeout?: number
|
1011
|
+
): void,
|
1012
|
+
|
1013
|
+
/**
|
1014
|
+
* Only run this test
|
1015
|
+
*
|
1016
|
+
* @param {JestTestName} Name of Test
|
1017
|
+
* @param {Function} Test
|
1018
|
+
* @param {number} Timeout for the test, in milliseconds.
|
1019
|
+
*/
|
1020
|
+
only(
|
1021
|
+
name: JestTestName,
|
1022
|
+
fn?: (done: JestDoneFn) => ?Promise<mixed>,
|
1023
|
+
timeout?: number
|
1024
|
+
): {
|
1025
|
+
each(
|
1026
|
+
...table: Array<Array<mixed> | mixed> | [Array<string>, string]
|
1027
|
+
): (
|
1028
|
+
name: JestTestName,
|
1029
|
+
fn?: (...args: Array<any>) => ?Promise<mixed>,
|
1030
|
+
timeout?: number
|
1031
|
+
) => void,
|
1032
|
+
},
|
1033
|
+
|
1034
|
+
/**
|
1035
|
+
* Skip running this test
|
1036
|
+
*
|
1037
|
+
* @param {JestTestName} Name of Test
|
1038
|
+
* @param {Function} Test
|
1039
|
+
* @param {number} Timeout for the test, in milliseconds.
|
1040
|
+
*/
|
1041
|
+
skip(
|
1042
|
+
name: JestTestName,
|
1043
|
+
fn?: (done: JestDoneFn) => ?Promise<mixed>,
|
1044
|
+
timeout?: number
|
1045
|
+
): void,
|
1046
|
+
|
1047
|
+
/**
|
1048
|
+
* Highlight planned tests in the summary output
|
1049
|
+
*
|
1050
|
+
* @param {String} Name of Test to do
|
1051
|
+
*/
|
1052
|
+
todo(name: string): void,
|
1053
|
+
|
1054
|
+
/**
|
1055
|
+
* Run the test concurrently
|
1056
|
+
*
|
1057
|
+
* @param {JestTestName} Name of Test
|
1058
|
+
* @param {Function} Test
|
1059
|
+
* @param {number} Timeout for the test, in milliseconds.
|
1060
|
+
*/
|
1061
|
+
concurrent(
|
1062
|
+
name: JestTestName,
|
1063
|
+
fn?: (done: JestDoneFn) => ?Promise<mixed>,
|
1064
|
+
timeout?: number
|
1065
|
+
): void,
|
1066
|
+
|
1067
|
+
/**
|
1068
|
+
* each runs this test against array of argument arrays per each run
|
1069
|
+
*
|
1070
|
+
* @param {table} table of Test
|
1071
|
+
*/
|
1072
|
+
each(
|
1073
|
+
...table: Array<Array<mixed> | mixed> | [Array<string>, string]
|
1074
|
+
): (
|
1075
|
+
name: JestTestName,
|
1076
|
+
fn?: (...args: Array<any>) => ?Promise<mixed>,
|
1077
|
+
timeout?: number
|
1078
|
+
) => void,
|
1079
|
+
};
|
1080
|
+
|
1081
|
+
declare function fit(
|
1082
|
+
name: JestTestName,
|
1083
|
+
fn: (done: JestDoneFn) => ?Promise<mixed>,
|
1084
|
+
timeout?: number
|
1085
|
+
): void;
|
1086
|
+
/** An individual test unit */
|
1087
|
+
declare var test: typeof it;
|
1088
|
+
/** A disabled group of tests */
|
1089
|
+
declare var xdescribe: typeof describe;
|
1090
|
+
/** A focused group of tests */
|
1091
|
+
declare var fdescribe: typeof describe;
|
1092
|
+
/** A disabled individual test */
|
1093
|
+
declare var xit: typeof it;
|
1094
|
+
/** A disabled individual test */
|
1095
|
+
declare var xtest: typeof it;
|
1096
|
+
|
1097
|
+
type JestPrettyFormatColors = {
|
1098
|
+
comment: { close: string, open: string },
|
1099
|
+
content: { close: string, open: string },
|
1100
|
+
prop: { close: string, open: string },
|
1101
|
+
tag: { close: string, open: string },
|
1102
|
+
value: { close: string, open: string },
|
1103
|
+
};
|
1104
|
+
|
1105
|
+
type JestPrettyFormatIndent = string => string;
|
1106
|
+
type JestPrettyFormatRefs = Array<any>;
|
1107
|
+
type JestPrettyFormatPrint = any => string;
|
1108
|
+
type JestPrettyFormatStringOrNull = string | null;
|
1109
|
+
|
1110
|
+
type JestPrettyFormatOptions = {|
|
1111
|
+
callToJSON: boolean,
|
1112
|
+
edgeSpacing: string,
|
1113
|
+
escapeRegex: boolean,
|
1114
|
+
highlight: boolean,
|
1115
|
+
indent: number,
|
1116
|
+
maxDepth: number,
|
1117
|
+
min: boolean,
|
1118
|
+
plugins: JestPrettyFormatPlugins,
|
1119
|
+
printFunctionName: boolean,
|
1120
|
+
spacing: string,
|
1121
|
+
theme: {|
|
1122
|
+
comment: string,
|
1123
|
+
content: string,
|
1124
|
+
prop: string,
|
1125
|
+
tag: string,
|
1126
|
+
value: string,
|
1127
|
+
|},
|
1128
|
+
|};
|
1129
|
+
|
1130
|
+
type JestPrettyFormatPlugin = {
|
1131
|
+
print: (
|
1132
|
+
val: any,
|
1133
|
+
serialize: JestPrettyFormatPrint,
|
1134
|
+
indent: JestPrettyFormatIndent,
|
1135
|
+
opts: JestPrettyFormatOptions,
|
1136
|
+
colors: JestPrettyFormatColors
|
1137
|
+
) => string,
|
1138
|
+
test: any => boolean,
|
1139
|
+
};
|
1140
|
+
|
1141
|
+
type JestPrettyFormatPlugins = Array<JestPrettyFormatPlugin>;
|
1142
|
+
|
1143
|
+
/** The expect function is used every time you want to test a value */
|
1144
|
+
declare var expect: {
|
1145
|
+
/** The object that you want to make assertions against */
|
1146
|
+
(
|
1147
|
+
value: any
|
1148
|
+
): JestExpectType &
|
1149
|
+
JestPromiseType &
|
1150
|
+
EnzymeMatchersType &
|
1151
|
+
DomTestingLibraryType &
|
1152
|
+
JestJQueryMatchersType &
|
1153
|
+
JestStyledComponentsMatchersType &
|
1154
|
+
JestExtendedMatchersType,
|
1155
|
+
|
1156
|
+
/** Add additional Jasmine matchers to Jest's roster */
|
1157
|
+
extend(matchers: { [name: string]: JestMatcher }): void,
|
1158
|
+
/** Add a module that formats application-specific data structures. */
|
1159
|
+
addSnapshotSerializer(pluginModule: JestPrettyFormatPlugin): void,
|
1160
|
+
assertions(expectedAssertions: number): void,
|
1161
|
+
hasAssertions(): void,
|
1162
|
+
any(value: mixed): JestAsymmetricEqualityType,
|
1163
|
+
anything(): any,
|
1164
|
+
arrayContaining(value: Array<mixed>): Array<mixed>,
|
1165
|
+
objectContaining(value: Object): Object,
|
1166
|
+
/** Matches any received string that contains the exact expected string. */
|
1167
|
+
stringContaining(value: string): string,
|
1168
|
+
stringMatching(value: string | RegExp): string,
|
1169
|
+
not: {
|
1170
|
+
arrayContaining: (value: $ReadOnlyArray<mixed>) => Array<mixed>,
|
1171
|
+
objectContaining: (value: {}) => Object,
|
1172
|
+
stringContaining: (value: string) => string,
|
1173
|
+
stringMatching: (value: string | RegExp) => string,
|
1174
|
+
},
|
1175
|
+
};
|
1176
|
+
|
1177
|
+
// TODO handle return type
|
1178
|
+
// http://jasmine.github.io/2.4/introduction.html#section-Spies
|
1179
|
+
declare function spyOn(value: mixed, method: string): Object;
|
1180
|
+
|
1181
|
+
/** Holds all functions related to manipulating test runner */
|
1182
|
+
declare var jest: JestObjectType;
|
1183
|
+
|
1184
|
+
/**
|
1185
|
+
* The global Jasmine object, this is generally not exposed as the public API,
|
1186
|
+
* using features inside here could break in later versions of Jest.
|
1187
|
+
*/
|
1188
|
+
declare var jasmine: {
|
1189
|
+
DEFAULT_TIMEOUT_INTERVAL: number,
|
1190
|
+
any(value: mixed): JestAsymmetricEqualityType,
|
1191
|
+
anything(): any,
|
1192
|
+
arrayContaining(value: Array<mixed>): Array<mixed>,
|
1193
|
+
clock(): JestClockType,
|
1194
|
+
createSpy(name: string): JestSpyType,
|
1195
|
+
createSpyObj(
|
1196
|
+
baseName: string,
|
1197
|
+
methodNames: Array<string>
|
1198
|
+
): { [methodName: string]: JestSpyType },
|
1199
|
+
objectContaining(value: Object): Object,
|
1200
|
+
stringMatching(value: string): string,
|
1201
|
+
};
|