Skip to content

Commit 12c3914

Browse files
author
ChaiJs Bot
committed
(data): Auto build _data
1 parent b95f09b commit 12c3914

3 files changed

Lines changed: 115 additions & 0 deletions

File tree

_data/plugin_keywords.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,9 @@
358358
"lodash": [
359359
"lodash"
360360
],
361+
"luxon": [
362+
"luxon"
363+
],
361364
"map": [
362365
"map"
363366
],

_data/plugins/chai_luxon.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"_id":"chai-luxon","_rev":"2-014e5d4a74e83625ceaae5c874c0103d","name":"chai-luxon","dist-tags":{"latest":"0.1.2"},"versions":{"0.1.0":{"name":"chai-luxon","version":"0.1.0","description":"date assertions for chai, powered by luxon","main":"index.js","scripts":{"lint":"eslint index.js /test","test":"nyc mocha","pretest":"npm run lint"},"keywords":["chai","luxon","test","assertions"],"author":{"name":"Craig Adam","email":"craig@adam11.ca"},"license":"MIT","devDependencies":{"chai":"^4.2.0","eslint":"^2.8.0","mocha":"^8.2.1","nyc":"^15.1.0"},"peerDependencies":{"chai":">= 4.0.0"},"dependencies":{"luxon":"^1.25.0"},"gitHead":"79d0e9d2ecae29c89fe4a3c01b9219e97ec6b92f","_id":"chai-luxon@0.1.0","_nodeVersion":"14.15.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-56VjMagUrWQpp6lgRL/1n3YUZl5KSViK8G1yt9imJxen23XWZwQkIuDk09qEvRyM2FCgks9viZ5srD15lycTpA==","shasum":"9dbe47d788ddd51e736c1b78185553b5b41e1fa9","tarball":"https://registry.npmjs.org/chai-luxon/-/chai-luxon-0.1.0.tgz","fileCount":5,"unpackedSize":14441,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgAT9mCRA9TVsSAnZWagAALJAP/2HM2wcHW+jSc59yh6Bo\njb8QP8d71tQeep2G+m2A0nPVDxmYZs7+XLVpBvTZIj3eY6vnVaFUqCEotBeM\n6OL2ejh2E3OZxPCIVPSGkj9vlu2KCv0QiyUeqchcJUOcEL/39odlGak7TAV/\nAPBb7fI9cdtmRgAkKe6U3QQyGEZpQ4LhQRw3UiPvuzgAaJn1/Wa95/pLGIy1\nN7W+eospH1/185Pz7Sw2ovYterHtcq19rLg1WRJ3ociaVwM3IOdG7235Lofo\nUmbGHgGSSEUNK9KKCjky4Gv+W2R2idWJDWErEtUWkE4oR/JPKM0Gvq/um+mW\ntJ4CKT3hQSCdEXYddiSw/TnO+r4AGCHLeEBogTkPFqxLCiqJ4DGgpGULTEEi\nUCRwwAnLUgddvGOoQKANefvfueNeErTmE0psiOrZYnJgj1ePhRDruME7Hxru\nQIeaOWwLBkkkqB+1bvLKCuWmiF7XrTaZPW1rHV5Ce5PG/1QQDclCJv69BUTr\nDisyDdx3i5IA9eRM0t5uw64CZmAdDhKPvPUrmbeLdiw/ic8wTxa3ccizyI7N\n8dyMBNtlSuQ89Fj7yt6spjKZ8UxknFGhA0hhlG9Y/rgRcLTWkwf3F1qot782\nXWK9u3JQ4WtJ0WbiA2FmA4Da+CnrR+7w2LzmHNqWWUHXesr/y8h1DQAYVZhf\nGXX7\r\n=LzXl\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"cadam11","email":"craig@adam11.ca"},"directories":{},"maintainers":[{"name":"cadam11","email":"craig@adam11.ca"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/chai-luxon_0.1.0_1610694502414_0.4719788900724271"},"_hasShrinkwrap":false},"0.1.1":{"name":"chai-luxon","version":"0.1.1","description":"date assertions for chai, powered by luxon","main":"index.js","scripts":{"lint":"eslint index.js /test","test":"nyc mocha","pretest":"npm run lint"},"keywords":["chai","luxon","test","assertions"],"author":{"name":"Craig Adam","email":"craig@adam11.ca"},"license":"MIT","devDependencies":{"chai":"^4.2.0","eslint":"^2.8.0","mocha":"^8.2.1","nyc":"^15.1.0"},"peerDependencies":{"chai":">= 4.0.0"},"dependencies":{"luxon":"^1.25.0"},"gitHead":"22ad78fcb108d0ee8bc53e5823a7fd633036ead5","_id":"chai-luxon@0.1.1","_nodeVersion":"14.15.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-8pLs13uy6/J2/nd3JDdgW05DNRARsqpR+tFHOg47MP3c6H0n7dQmXp3aWwsSgaXpDUZyQplCqNW7g3XWPFTXIw==","shasum":"8663784eb5c726a50a9d81fc91f451bf0102cfb0","tarball":"https://registry.npmjs.org/chai-luxon/-/chai-luxon-0.1.1.tgz","fileCount":5,"unpackedSize":14468,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgA6h5CRA9TVsSAnZWagAAJMwQAICDGZT7JDJb08h12k2l\nrk2ozgjoYapBCfSGVEI2WZlf+lamceyEPeat4xcUye1tChm9VjXDnoqUNHqQ\nEHcTfsGWWOn+vVn6HkKHq0+qcE4brZ9LCBXe02GH6+1GggykF7CyD1NcrvkB\ntMoBDW7ygzLcLrsMD1qlBAbSjbbbA7pKq51BKgAAKbxCctmkFMShS9GBDIJm\nBm3/iRDmpBVMDM8bVxZFwzP2B4oBeoyrQACSTX50OIgpaJ2hNSyXWy3jvyvZ\nYH3Hr602KwDjxdIg1WCyjUfifwsM3gLRigTcfyNA/rFUpca/2syrZ+kqFn5Y\nZ3qyqLNuOV3zM/V0kfAXdVImYBWbm7f/IUxvjcqeprsb8ttza1l0ZeJNyc4y\nTyD46a8NRbW7+ufB06ZLxyylQ3Rf6QzZXBqd7e3GiwKSQnOx54SPcZUbHSBN\njmIxiuS5EfbSjXNGuchboiFNxbwaV5BS1aL1zLTqskQff8pZe5JzN+vqCAgq\nIBD7NcyBktJJLpR7bunUs1pK2xpEnDNn3QspsUzB5i8kqLlbP3cbnnMsmE8f\nQDjaPP3+CqzLPESubITlJDNV2CRTleu9uS2jN01GHlkDZL4JNemSTsSwkZ2d\nwWgA+Da6ladlL3Biw/3T7HPp6yzItaoZdLb+4Y/ACWF73dazjKkxvO8KloeB\nQpm1\r\n=UGJd\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"cadam11","email":"craig@adam11.ca"},"directories":{},"maintainers":[{"name":"cadam11","email":"craig@adam11.ca"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/chai-luxon_0.1.1_1610852472653_0.06299799295998043"},"_hasShrinkwrap":false},"0.1.2":{"name":"chai-luxon","version":"0.1.2","description":"date assertions for chai, powered by luxon","main":"index.js","scripts":{"lint":"eslint index.js /test","test":"nyc mocha","pretest":"npm run lint"},"keywords":["chai","luxon","test","assertions","chai-plugin"],"author":{"name":"Craig Adam","email":"craig@adam11.ca"},"license":"MIT","devDependencies":{"chai":"^4.2.0","eslint":"^2.8.0","mocha":"^8.2.1","nyc":"^15.1.0"},"peerDependencies":{"chai":">= 4.0.0"},"dependencies":{"luxon":"^1.25.0"},"gitHead":"e41ab5009313cac311429f9fa5be0cb61e5a9373","_id":"chai-luxon@0.1.2","_nodeVersion":"14.15.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-HU1OiwumW3/UQoN+y+f2D/O3wLrxoUXgyt/kT1qvcVWpUOu7VXcO0LXxeVmXZDFFl3oH97HqB91PyT5aIzA1XA==","shasum":"382b368c668cdbb026de577ef11126989e944421","tarball":"https://registry.npmjs.org/chai-luxon/-/chai-luxon-0.1.2.tgz","fileCount":5,"unpackedSize":14487,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgBP9WCRA9TVsSAnZWagAAXk4P+wU9njeN1e7paCez9vtw\n9xEUqC8x/vB1lMM1ByCX8rBvlblej4b33DblWWqfDt96tSBkj5iGLiH2GRwQ\n9ZJJslRilbcKQ4PHe3o1EKlmK/5e49UpaNTMZpiut9r3RBax0thQKFv8UhvT\n2bxK/Lzmp8ZwlzFTyneB9wxKm4vZLLpm3qHZgqQjWb/yA8TGTneJFkV0zsVa\n2ejYrj4SQ3nDth6/GmwJ3jGxZXLXuBVwK08N3J0r/o4+vKPxLlEcGoRAGTMG\nnKSgvcSROimZgN7edfsAE9PbDum7adKj0fJKAdfUUHnDsZjD/1iz6DrvSQui\nYcBR5LRlq8rAeH4/P0yFXwstWl1hWKPt5WbKyyC3XYUpUv5EwWw3UgGErS7H\n0Gv4tZ/Ad+Dq25tZ/tQI92L5b5z7VCBoLi1NJqHVOCPbFdCOdUmmizks4Kr8\ns+zz6ivPiMPeyQIdXV61dNVe1oJ3JVGOZGQ+lnzkAdzvN8qGUrESYrhHe9im\nAvQVs3sOG0nTxynUssU/DHg3t0ifbHKFcb1OaByiKu/Jt9NQz+t1c1X95wlK\nv7ooXSzHjGfFSt2ZYYwFz7mw6yyVQH0ljpR2j1KowmEZmBrx4lzSFmz2/UnK\nANA3MAPx7a/qzcfM7tvh2fVmJQYmYxKYn88gbTuYzdM35gklXJ4oh9FPnNJ1\n1cqc\r\n=jf55\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"cadam11","email":"craig@adam11.ca"},"directories":{},"maintainers":[{"name":"cadam11","email":"craig@adam11.ca"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/chai-luxon_0.1.2_1610940246084_0.6470269370615578"},"_hasShrinkwrap":false}},"time":{"created":"2021-01-15T07:08:22.414Z","0.1.0":"2021-01-15T07:08:22.551Z","modified":"2021-01-18T03:24:08.479Z","0.1.1":"2021-01-17T03:01:12.809Z","0.1.2":"2021-01-18T03:24:06.199Z"},"maintainers":[{"name":"cadam11","email":"craig@adam11.ca"}],"description":"date assertions for chai, powered by luxon","keywords":["chai","luxon","test","assertions","chai-plugin"],"author":{"name":"Craig Adam","email":"craig@adam11.ca"},"license":"MIT","readme":"# chai-luxon\n\nA [Chai](https://www.chaijs.com/) plugin that adds matchers for dates and formatted date strings powered by [Luxon](https://moment.github.io/luxon/)\n\n[![NPM Version](https://img.shields.io/npm/v/chai-luxon.svg?style=flat)]()\n[![NPM License](https://img.shields.io/npm/l/all-contributors.svg?style=flat)](http://www.tldrlegal.com/license/mit-license)\n[![NPM Downloads](https://img.shields.io/npm/dt/chai-luxon.svg?style=flat)]() \n[![NPM](https://nodei.co/npm/chai-luxon.png?downloads=true)](https://www.npmjs.com/package/chai-luxon) \n## Using\n\nAlso see the [tests](https://github.com/cadam11/chai-luxon/tree/master/test/)\n\n### browser-side\n\ninclude chai luxon after chai and luxon:\n\n <script src=\"luxon.js\"></script>\n <script src=\"chai.js\"></script>\n <script src=\"chai-luxon.js\"></script>\n\n### server-side\n\nhave chai use chai-luxon:\n\n```javascript\nvar chai = require('chai');\nchai.use(require('chai-luxon'));\n```\n\n## Assertions\n\nCompare any Luxon compatible date/string/whatever with another, with optional granularity.\n\nWhen using granularity, please use one of the following: `year`, `month`, `week`, `day`, `hour`, `minute`, `second`. When using tdd-style assertions, if you do not use one of the listed granularities, the argument will be interpreted as a custom error message.\n\n### sameDateTime\n\n```javascript\nvar dateString = '2020-04-21',\n date = new Date(2020, 3, 21),\n milliseconds = 1461222000000, // assumes system has PDT timezone\n obj = { year: 2020, month: 3, day: 21 },\n luxonDateTime = DateTime.fromISO('2020-04-21'),\n oneDayLater = DateTime.fromISO('2020-04-22');\n\n// using should-style assertions\ndateString.should.be.sameDateTime(date);\ndateString.should.be.sameDateTime(oneDayLater, 'month');\n\n// using expect-style assertions\nexpect(milliseconds).to.be.sameDateTime(obj);\nexpect(dateString).to.be.sameDateTime(oneDayLater, 'month');\n\n// using tdd assertions\nassert.sameDateTime(luxonDateTime, luxonDateTime);\nassert.sameDateTime(luxonDateTime, oneDayLater, 'month');\nassert.sameDateTime(luxonDateTime, oneDayLater, 'month', 'custom error message');\nassert.sameDateTime(luxonDateTime, oneDayLater, 'custom error message'); // fails\n```\n\n### beforeDateTime\n\n```javascript\nvar dateString = '2020-04-21',\n oneDayLater = '2020-04-22';\n\n// using should-style assertions\ndateString.should.be.beforeDateTime(oneDayLater);\ndateString.should.be.beforeDateTime(oneDayLater, 'month'); // fails\n\n// using expect-style assertions\nexpect(dateString).to.be.beforeDateTime(oneDayLater);\nexpect(dateString).to.be.beforeDateTime(oneDayLater, 'month'); // fails\n\n// using tdd assertions\nassert.beforeDateTime(luxonDateTime, oneDayLater);\nassert.beforeDateTime(luxonDateTime, oneDayLater, 'month'); // fails\nassert.beforeDateTime(luxonDateTime, oneDayLater, 'month', 'custom error message'); // fails\nassert.beforeDateTime(luxonDateTime, oneDayLater, 'custom error message');\n```\n\n### afterDateTime\n\n```javascript\nvar dateString = '2020-04-21',\n oneDayLater = '2020-04-22';\n\n// using should-style assertions\noneDayLater.should.be.afterDateTime(luxonDateTime);\noneDayLater.should.be.afterDateTime(luxonDateTime, 'month'); // fails\n\n// using expect-style assertions\nexpect(oneDayLater).to.be.afterDateTime(luxonDateTime);\nexpect(oneDayLater).to.be.afterDateTime(luxonDateTime, 'month'); // fails\n\n// using tdd assertions\nassert.afterDateTime(oneDayLater, luxonDateTime);\nassert.afterDateTime(oneDayLater, luxonDateTime, 'month'); // fails\nassert.afterDateTime(oneDayLater, luxonDateTime, 'month', 'custom error message'); // fails\nassert.afterDateTime(oneDayLater, luxonDateTime, 'custom error message');\n```\n\n# Thanks\n\nThanks to [picardy](https://github.com/picardy/chai-moment/) for chai-moment, which was the basis for this.\n","readmeFilename":"README.md"}

plugins/chai_luxon.md

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
---
2+
layout: plugin
3+
permalink: plugins/chai-luxon/
4+
pluginName: chai-luxon
5+
---
6+
7+
# chai-luxon
8+
9+
A [Chai](https://www.chaijs.com/) plugin that adds matchers for dates and formatted date strings powered by [Luxon](https://moment.github.io/luxon/)
10+
11+
[![NPM Version](https://img.shields.io/npm/v/chai-luxon.svg?style=flat)]()
12+
[![NPM License](https://img.shields.io/npm/l/all-contributors.svg?style=flat)](http://www.tldrlegal.com/license/mit-license)
13+
[![NPM Downloads](https://img.shields.io/npm/dt/chai-luxon.svg?style=flat)]()
14+
[![NPM](https://nodei.co/npm/chai-luxon.png?downloads=true)](https://www.npmjs.com/package/chai-luxon)
15+
## Using
16+
17+
Also see the [tests](https://github.com/cadam11/chai-luxon/tree/master/test/)
18+
19+
### browser-side
20+
21+
include chai luxon after chai and luxon:
22+
23+
<script src="luxon.js"></script>
24+
<script src="chai.js"></script>
25+
<script src="chai-luxon.js"></script>
26+
27+
### server-side
28+
29+
have chai use chai-luxon:
30+
31+
```javascript
32+
var chai = require('chai');
33+
chai.use(require('chai-luxon'));
34+
```
35+
36+
## Assertions
37+
38+
Compare any Luxon compatible date/string/whatever with another, with optional granularity.
39+
40+
When using granularity, please use one of the following: `year`, `month`, `week`, `day`, `hour`, `minute`, `second`. When using tdd-style assertions, if you do not use one of the listed granularities, the argument will be interpreted as a custom error message.
41+
42+
### sameDateTime
43+
44+
```javascript
45+
var dateString = '2020-04-21',
46+
date = new Date(2020, 3, 21),
47+
milliseconds = 1461222000000, // assumes system has PDT timezone
48+
obj = { year: 2020, month: 3, day: 21 },
49+
luxonDateTime = DateTime.fromISO('2020-04-21'),
50+
oneDayLater = DateTime.fromISO('2020-04-22');
51+
52+
// using should-style assertions
53+
dateString.should.be.sameDateTime(date);
54+
dateString.should.be.sameDateTime(oneDayLater, 'month');
55+
56+
// using expect-style assertions
57+
expect(milliseconds).to.be.sameDateTime(obj);
58+
expect(dateString).to.be.sameDateTime(oneDayLater, 'month');
59+
60+
// using tdd assertions
61+
assert.sameDateTime(luxonDateTime, luxonDateTime);
62+
assert.sameDateTime(luxonDateTime, oneDayLater, 'month');
63+
assert.sameDateTime(luxonDateTime, oneDayLater, 'month', 'custom error message');
64+
assert.sameDateTime(luxonDateTime, oneDayLater, 'custom error message'); // fails
65+
```
66+
67+
### beforeDateTime
68+
69+
```javascript
70+
var dateString = '2020-04-21',
71+
oneDayLater = '2020-04-22';
72+
73+
// using should-style assertions
74+
dateString.should.be.beforeDateTime(oneDayLater);
75+
dateString.should.be.beforeDateTime(oneDayLater, 'month'); // fails
76+
77+
// using expect-style assertions
78+
expect(dateString).to.be.beforeDateTime(oneDayLater);
79+
expect(dateString).to.be.beforeDateTime(oneDayLater, 'month'); // fails
80+
81+
// using tdd assertions
82+
assert.beforeDateTime(luxonDateTime, oneDayLater);
83+
assert.beforeDateTime(luxonDateTime, oneDayLater, 'month'); // fails
84+
assert.beforeDateTime(luxonDateTime, oneDayLater, 'month', 'custom error message'); // fails
85+
assert.beforeDateTime(luxonDateTime, oneDayLater, 'custom error message');
86+
```
87+
88+
### afterDateTime
89+
90+
```javascript
91+
var dateString = '2020-04-21',
92+
oneDayLater = '2020-04-22';
93+
94+
// using should-style assertions
95+
oneDayLater.should.be.afterDateTime(luxonDateTime);
96+
oneDayLater.should.be.afterDateTime(luxonDateTime, 'month'); // fails
97+
98+
// using expect-style assertions
99+
expect(oneDayLater).to.be.afterDateTime(luxonDateTime);
100+
expect(oneDayLater).to.be.afterDateTime(luxonDateTime, 'month'); // fails
101+
102+
// using tdd assertions
103+
assert.afterDateTime(oneDayLater, luxonDateTime);
104+
assert.afterDateTime(oneDayLater, luxonDateTime, 'month'); // fails
105+
assert.afterDateTime(oneDayLater, luxonDateTime, 'month', 'custom error message'); // fails
106+
assert.afterDateTime(oneDayLater, luxonDateTime, 'custom error message');
107+
```
108+
109+
# Thanks
110+
111+
Thanks to [picardy](https://github.com/picardy/chai-moment/) for chai-moment, which was the basis for this.

0 commit comments

Comments
 (0)