99 lines
6.3 KiB
JSON
99 lines
6.3 KiB
JSON
{
|
|
"_args": [
|
|
[
|
|
{
|
|
"raw": "jest-mock@^22.2.0",
|
|
"scope": null,
|
|
"escapedName": "jest-mock",
|
|
"name": "jest-mock",
|
|
"rawSpec": "^22.2.0",
|
|
"spec": ">=22.2.0 <23.0.0",
|
|
"type": "range"
|
|
},
|
|
"/Volumes/2009-SSD/GT2/GT2-iOS/node_modules/jest-environment-jsdom"
|
|
]
|
|
],
|
|
"_from": "jest-mock@>=22.2.0 <23.0.0",
|
|
"_id": "jest-mock@22.2.0",
|
|
"_inCache": true,
|
|
"_location": "/jest-mock",
|
|
"_nodeVersion": "8.9.1",
|
|
"_npmOperationalInternal": {
|
|
"host": "s3://npm-registry-packages",
|
|
"tmp": "tmp/jest-mock_22.2.0_1517999155870_0.20858221398591348"
|
|
},
|
|
"_npmUser": {
|
|
"name": "mjesun",
|
|
"email": "mjesun@hotmail.com"
|
|
},
|
|
"_npmVersion": "5.5.1",
|
|
"_phantomChildren": {},
|
|
"_requested": {
|
|
"raw": "jest-mock@^22.2.0",
|
|
"scope": null,
|
|
"escapedName": "jest-mock",
|
|
"name": "jest-mock",
|
|
"rawSpec": "^22.2.0",
|
|
"spec": ">=22.2.0 <23.0.0",
|
|
"type": "range"
|
|
},
|
|
"_requiredBy": [
|
|
"/jest-environment-jsdom",
|
|
"/jest-environment-node"
|
|
],
|
|
"_resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-22.2.0.tgz",
|
|
"_shasum": "444b3f9488a7473adae09bc8a77294afded397a7",
|
|
"_shrinkwrap": null,
|
|
"_spec": "jest-mock@^22.2.0",
|
|
"_where": "/Volumes/2009-SSD/GT2/GT2-iOS/node_modules/jest-environment-jsdom",
|
|
"browser": "build-es5/index.js",
|
|
"bugs": {
|
|
"url": "https://github.com/facebook/jest/issues"
|
|
},
|
|
"dependencies": {},
|
|
"description": "## API",
|
|
"devDependencies": {},
|
|
"directories": {},
|
|
"dist": {
|
|
"integrity": "sha512-eOfoUYLOB/JlxChOFkh/bzpWGqUXb9I+oOpkprHHs9L7nUNfL8Rk28h1ycWrqzWCEQ/jZBg/xIv7VdQkfAkOhw==",
|
|
"shasum": "444b3f9488a7473adae09bc8a77294afded397a7",
|
|
"tarball": "https://registry.npmjs.org/jest-mock/-/jest-mock-22.2.0.tgz",
|
|
"fileCount": 4,
|
|
"unpackedSize": 121573
|
|
},
|
|
"homepage": "https://github.com/facebook/jest#readme",
|
|
"license": "MIT",
|
|
"main": "build/index.js",
|
|
"maintainers": [
|
|
{
|
|
"name": "aaronabramov",
|
|
"email": "aaron@abramov.io"
|
|
},
|
|
{
|
|
"name": "cpojer",
|
|
"email": "christoph.pojer@gmail.com"
|
|
},
|
|
{
|
|
"name": "fb",
|
|
"email": "opensource+npm@fb.com"
|
|
},
|
|
{
|
|
"name": "jeanlauliac",
|
|
"email": "jean@lauliac.com"
|
|
},
|
|
{
|
|
"name": "mjesun",
|
|
"email": "mjesun@hotmail.com"
|
|
}
|
|
],
|
|
"name": "jest-mock",
|
|
"optionalDependencies": {},
|
|
"readme": "# jest-mock\n\n## API\n\n### `constructor(global)`\n\nCreates a new module mocker that generates mocks as if they were created in an\nenvironment with the given global object.\n\n### `generateFromMetadata(metadata)`\n\nGenerates a mock based on the given metadata (Metadata for the mock in the\nschema returned by the getMetadata method of this module). Mocks treat functions\nspecially, and all mock functions have additional members, described in the\ndocumentation for `fn` in this module.\n\nOne important note: function prototypes are handled specially by this mocking\nframework. For functions with prototypes, when called as a constructor, the mock\nwill install mocked function members on the instance. This allows different\ninstances of the same constructor to have different values for its mocks member\nand its return values.\n\n### `getMetadata(component)`\n\nInspects the argument and returns its schema in the following recursive format:\n\n```\n{\n type: ...\n members: {}\n}\n```\n\nWhere type is one of `array`, `object`, `function`, or `ref`, and members is an\noptional dictionary where the keys are member names and the values are metadata\nobjects. Function prototypes are defined simply by defining metadata for the\n`member.prototype` of the function. The type of a function prototype should\nalways be `object`. For instance, a simple class might be defined like this:\n\n```js\nconst classDef = {\n type: 'function',\n members: {\n staticMethod: {type: 'function'},\n prototype: {\n type: 'object',\n members: {\n instanceMethod: {type: 'function'},\n },\n },\n },\n};\n```\n\nMetadata may also contain references to other objects defined within the same\nmetadata object. The metadata for the referent must be marked with `refID` key\nand an arbitrary value. The referrer must be marked with a `ref` key that has\nthe same value as object with refID that it refers to. For instance, this\nmetadata blob:\n\n```js\nconst refID = {\n type: 'object',\n refID: 1,\n members: {\n self: {ref: 1},\n },\n};\n```\n\ndefines an object with a slot named `self` that refers back to the object.\n\n### `fn`\n\nGenerates a stand-alone function with members that help drive unit tests or\nconfirm expectations. Specifically, functions returned by this method have the\nfollowing members:\n\n##### `.mock`\n\nAn object with three members, `calls`, `instances` and `timestamps`, which are\nall lists. The items in the `calls` list are the arguments with which the\nfunction was called. The \"instances\" list stores the value of 'this' for each\ncall to the function. This is useful for retrieving instances from a\nconstructor. The `timestamps` list stores a number timestamp every time the mock\nis called.\n\n##### `.mockReturnValueOnce(value)`\n\nPushes the given value onto a FIFO queue of return values for the function.\n\n##### `.mockReturnValue(value)`\n\nSets the default return value for the function.\n\n##### `.mockImplementationOnce(function)`\n\nPushes the given mock implementation onto a FIFO queue of mock implementations\nfor the function.\n\n##### `.mockImplementation(function)`\n\nSets the default mock implementation for the function.\n\n##### `.mockReturnThis()`\n\nSyntactic sugar for .mockImplementation(function() {return this;})\n\nIn case both `mockImplementationOnce()/mockImplementation()` and\n`mockReturnValueOnce()/mockReturnValue()` are called. The priority of which to\nuse is based on what is the last call:\n\n* if the last call is mockReturnValueOnce() or mockReturnValue(), use the\n specific return value or default return value. If specific return values are\n used up or no default return value is set, fall back to try\n mockImplementation();\n* if the last call is mockImplementationOnce() or mockImplementation(), run the\n specific implementation and return the result or run default implementation\n and return the result.\n",
|
|
"readmeFilename": "README.md",
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "git+https://github.com/facebook/jest.git"
|
|
},
|
|
"version": "22.2.0"
|
|
}
|