-
Notifications
You must be signed in to change notification settings - Fork 0
/
package.json
75 lines (75 loc) · 6.28 KB
/
package.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
{
"_args": [
[
{
"raw": "lolex@https://registry.npmjs.org/lolex/-/lolex-1.3.2.tgz",
"scope": null,
"escapedName": "lolex",
"name": "lolex",
"rawSpec": "https://registry.npmjs.org/lolex/-/lolex-1.3.2.tgz",
"spec": "https://registry.npmjs.org/lolex/-/lolex-1.3.2.tgz",
"type": "remote"
},
"/Users/jennyphan/AngularToolingSamples/Angular4/aboutMe-app/functions/node_modules/firebase-admin"
]
],
"_from": "lolex@https://registry.npmjs.org/lolex/-/lolex-1.3.2.tgz",
"_id": "lolex@1.3.2",
"_inCache": true,
"_location": "/firebase-admin/lolex",
"_phantomChildren": {},
"_requested": {
"raw": "lolex@https://registry.npmjs.org/lolex/-/lolex-1.3.2.tgz",
"scope": null,
"escapedName": "lolex",
"name": "lolex",
"rawSpec": "https://registry.npmjs.org/lolex/-/lolex-1.3.2.tgz",
"spec": "https://registry.npmjs.org/lolex/-/lolex-1.3.2.tgz",
"type": "remote"
},
"_requiredBy": [
"/firebase-admin",
"/firebase-admin/sinon"
],
"_resolved": "https://registry.npmjs.org/lolex/-/lolex-1.3.2.tgz",
"_shasum": "7c3da62ffcb30f0f5a80a2566ca24e45d8a01f31",
"_shrinkwrap": null,
"_spec": "lolex@https://registry.npmjs.org/lolex/-/lolex-1.3.2.tgz",
"_where": "/Users/jennyphan/AngularToolingSamples/Angular4/aboutMe-app/functions/node_modules/firebase-admin",
"author": {
"name": "Christian Johansen"
},
"bugs": {
"url": "http://github.com/sinonjs/lolex/issues"
},
"dependencies": {},
"description": "Fake JavaScript timers",
"devDependencies": {
"browserify": ">=5.9 <6",
"jslint": "^0.6.6",
"mocha": ">=1.21 <2",
"mochify": ">=1.0 <2",
"referee": "~1.0",
"sinon": "~1.10"
},
"homepage": "http://github.com/sinonjs/lolex",
"license": "BSD-3-Clause",
"main": "./src/lolex.js",
"name": "lolex",
"optionalDependencies": {},
"readme": "# Lolex [![Build Status](https://secure.travis-ci.org/sinonjs/lolex.png)](http://travis-ci.org/sinonjs/lolex)\n\nJavaScript implementation of the timer APIs; `setTimeout`, `clearTimeout`,\n`setImmediate`, `clearImmediate`, `setInterval`, `clearInterval`, and\n`requestAnimationFrame`, along with a clock instance that controls the flow of\ntime. Lolex also provides a `Date` implementation that gets its time from the\nclock.\n\nLolex can be used to simulate passing time in automated tests and other\nsituations where you want the scheduling semantics, but don't want to actually\nwait. Lolex is extracted from [Sinon.JS](https://github.com/sinonjs/sinon.js).\n\n## Installation\n\nLolex can be installed using `npm`:\n\n```sh\nnpm install lolex\n```\n\nIf you want to use Lolex in a browser, you have a few options. Releases are\nhosted on the [sinonjs.org](http://sinonjs.org/download/) website. You can also\nget the node module and build a file for the browser using browserify:\n\n```sh\nnpm install lolex\nnpm install browserify # If you don't already have it globally installed\nbrowserify node_modules/lolex/lolex.js\n```\n\n## Usage\n\nTo use lolex, create a new clock, schedule events on it using the timer\nfunctions and pass time using the `tick` method.\n\n```js\n// In the browser distribution, a global `lolex` is already available\nvar lolex = require(\"lolex\");\nvar clock = lolex.createClock();\n\nclock.setTimeout(function () {\n console.log(\"The poblano is a mild chili pepper originating in the state of Puebla, Mexico.\");\n}, 15);\n\n// ...\n\nclock.tick(15);\n```\n\nUpon executing the last line, an interesting fact about the\n[Poblano](http://en.wikipedia.org/wiki/Poblano) will be printed synchronously to\nthe screen. If you want to simulate asynchronous behavior, you have to use your\nimagination when calling the various functions.\n\n### Faking the native timers\n\nWhen using lolex to test timers, you will most likely want to replace the native\ntimers such that calling `setTimeout` actually schedules a callback with your\nclock instance, not the browser's internals.\n\nTo hijack timers in another context, use the `install` method. You can then call\n`uninstall` later to restore things as they were again.\n\n```js\nvar lolex = require(\"lolex\");\nvar clock = lolex.install(window);\n\nwindow.setTimeout(fn, 15); // Schedules with clock.setTimeout\n\nclock.uninstall();\n\n// window.setTimeout is restored to the native implementation\n```\n\nIn 90% av the times, you want to install the timers onto the global object.\nCalling `install` with no arguments achieves this:\n\n```js\nvar clock = lolex.install();\n\n// Equivalent to\n// var clock = lolex.install(typeof global !== \"undefined\" ? global : window);\n```\n\n## API Reference\n\n### `var clock = lolex.createClock([now])`\n\n### `var clock = lolex.install([context[, now[, toFake]]])`\n\n### `var clock = lolex.install([now[, toFake]])`\n\n### `var id = clock.setTimeout(callback, timeout)`\n\n### `clock.clearTimeout(id)`\n\n### `var id = clock.setInterval(callback, timeout)`\n\n### `clock.clearInterval(id)`\n\n### `var id = clock.setImmediate(callback)`\n\n### `clock.clearImmediate(id)`\n\n### `clock.tick(time)`\n\n### `clock.setSystemTime([now])`\nThis simulates a user changing the system clock while your program is running.\nIt affects the current time but it does not in itself cause e.g. timers to fire; they will fire exactly as they would have done without the call to setSystemTime().\n\n### `clock.uninstall()`\n\n### `Date`\n\n## Running tests\n\nLolex has a comprehensive test suite. If you're thinking of contributing bug\nfixes or suggest new features, you need to make sure you have not broken any\ntests. You are also expected to add tests for any new behavior.\n\n### On node:\n\n```sh\nnpm test\n```\n\nOr, if you prefer slightly less verbose output:\n\n```\nmocha ./test/lolex-test.js\n```\n\n### In the browser\n\n\n\n## License\n\nBSD 3-clause \"New\" or \"Revised\" License (see LICENSE file)\n",
"readmeFilename": "Readme.md",
"repository": {
"type": "git",
"url": "git+ssh://git@github.com/sinonjs/lolex.git"
},
"scripts": {
"bundle": "browserify -s lolex -o lolex.js src/lolex.js",
"lint": "$(npm bin)/jslint src/**/*.js",
"test": "npm run lint && npm run test-node && npm run test-headless && npm run test-cloud",
"test-cloud": "mochify --wd",
"test-headless": "mochify",
"test-node": "mocha -R dot"
},
"version": "1.3.2"
}