Skip to content

Commit 6c4010f

Browse files
author
ChaiJs Bot
committed
(data): Auto build _data
1 parent f71d115 commit 6c4010f

4 files changed

Lines changed: 108 additions & 1 deletion

File tree

_data/plugin_keywords.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@
1717
"JSON",
1818
"json"
1919
],
20+
"Monad": [
21+
"Monad"
22+
],
23+
"Result": [
24+
"Result"
25+
],
2026
"ajv": [
2127
"ajv"
2228
],

_data/plugins/_faltest_chai.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

_data/plugins/chai_kekka.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"_id":"chai-kekka","_rev":"1-646caea441dac0afda374a6f05f9329e","name":"chai-kekka","dist-tags":{"latest":"1.0.0"},"versions":{"0.0.1":{"name":"chai-kekka","version":"0.0.1","description":"Chai plugin for Kekka","repository":{"type":"git","url":"git+https://github.com/apemb/chai-kekka.git"},"homepage":"https://github.com/apemb/chai-kekka","main":"index.js","scripts":{"lint":"eslint src/**.js test/**.js --fix","test":"mocha --recursive --exit"},"keywords":["chai","test","chai-plugin","Result","Monad"],"author":{"name":"Antoine Boileau"},"license":"ISC","dependencies":{"kekka":"^1.0.0","chai":"^4.2.0"},"devDependencies":{"chai-as-promised":"^7.1.1","eslint":"^7.15.0","eslint-config-standard":"^16.0.2","eslint-plugin-import":"^2.22.1","eslint-plugin-node":"^11.1.0","eslint-plugin-promise":"^4.2.1","mocha":"^8.2.1"},"gitHead":"835af5f306af64c8887348ae478607733aab616f","bugs":{"url":"https://github.com/apemb/chai-kekka/issues"},"_id":"chai-kekka@0.0.1","_nodeVersion":"10.16.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-UIkFA9+EPFSYT198yL6zq3snphHco13f8OJrWRkJ+XO7l87lkXmB9ljmcIx+H64Gq3DuGBOR/Eiw0OQbQcOUtw==","shasum":"66a63cf3c8c4f6b83c93ed802e0173b1b1433bd1","tarball":"https://registry.npmjs.org/chai-kekka/-/chai-kekka-0.0.1.tgz","fileCount":17,"unpackedSize":22342,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf9c7GCRA9TVsSAnZWagAAFssP/i4Yk8iHIk6O/cTlXtjR\nPAVJ8n2IZJAgPFl3yKAxGTXY8kc9qS8c74wiSgK9vaLIcQrxeIAaFVMbQ8zF\nLavxeThhYYhAM9su5AYzFnuzPbqjKOleef2fEPTN+hVCESi2nydkf/FI1yHS\nH/MghM4WVFKVaX5Fqj9w8iUj7MS5S0a40NjSFhYCCJRg4neZQF7Rc2NXOgVg\n6XvSFmnsBncFB+5s/RrJ1U2xYDgKyymJZ8XBPuNp1Nt9U015gKsH1cH1eEar\nhm46ccOBYlZRXaoEYHzvc8D84X2w2EcNWqNqPx07ut7nagAIeLVJTt2OYu/T\n4A6zgqnEpqRhxpAUZoWhQ1d4vz3v+LzmRDZH0NxBxGdJlhckf4BpG4m7merA\nR4yqbYLsNtbjHLJwRzy4Zq//EAbbfE9nmz1rXv0lIczmp1hWug3Zqnfy8oeC\n7XgGS7No5vsArLIVaW4djuhv4+obKhc0yX0hxpTsDB5dIGJsbBJLPqrWwibJ\nNwovYLMcx13yVfi8Alo28HCDW20cM5PSc77Mwddz67jXfNrYQ3BtuC1GxEuc\nMuzolAD3hAVBs2RZ6kaeX7qqMdyLWgZeHg9pp8D6x6loys7mHNbXIiV06FTU\nkOoLs/JeVzyed5gisX0CNTaeOtyBbSe2WQuoFxxoSbeXPJCthACJXt1jfoYo\nKhG6\r\n=ScUt\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"apemb","email":"apem.boileau@gmail.com"},"directories":{},"maintainers":[{"name":"apemb","email":"apem.boileau@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/chai-kekka_0.0.1_1609944774138_0.10193912416044659"},"_hasShrinkwrap":false},"1.0.0":{"name":"chai-kekka","version":"1.0.0","description":"Chai plugin for Kekka","repository":{"type":"git","url":"git+https://github.com/apemb/chai-kekka.git"},"homepage":"https://github.com/apemb/chai-kekka","main":"index.js","scripts":{"lint":"eslint src/**.js test/**.js --fix","test":"mocha --recursive --exit"},"keywords":["chai","test","chai-plugin","Result","Monad"],"author":{"name":"Antoine Boileau"},"license":"ISC","dependencies":{"kekka":"^1.0.0","chai":"^4.2.0"},"devDependencies":{"chai-as-promised":"^7.1.1","eslint":"^7.15.0","eslint-config-standard":"^16.0.2","eslint-plugin-import":"^2.22.1","eslint-plugin-node":"^11.1.0","eslint-plugin-promise":"^4.2.1","mocha":"^8.2.1"},"gitHead":"18d944dd47104384c70e43d3b629bdecbaff2211","bugs":{"url":"https://github.com/apemb/chai-kekka/issues"},"_id":"chai-kekka@1.0.0","_nodeVersion":"10.16.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-Vrkdg3myIo9/BbFA+BO9xPwu74I+FkNH4JBEjgZZ3scyBFIjtkBuBnabO6a6Uh6ehG/MDzYIlcJe6vu0986W0Q==","shasum":"9949f1724089a2efd1673cc0806cc84425055eb1","tarball":"https://registry.npmjs.org/chai-kekka/-/chai-kekka-1.0.0.tgz","fileCount":17,"unpackedSize":25292,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf9eCRCRA9TVsSAnZWagAA1LkP/jTAN8AZ8bwe2D2hCD9p\nl15KO5yfMLBPepu6UUO1T7gegkfK5qsa0VxOqNzD+53bnheI/ctJ285KZAdH\nLdte9R3h2aEX+y77mBK2Ln6A4gDpbF6XqI/QAv1VQE3wOtOwVDc4yPZw4wmi\nNj+fc5g+4dTTpY6XptcjI+2LMDRLbw69fOyw5wbMbVvN9A4DenlxRsSZHvvW\nIO8qvsB8xObN7pezA3T/GgRw4iHDFZxbnoRw8uzM53FW1wE/U3lgcWbSqSh4\nq+/d7YCWFaPCvqOJVGJ+bVAgvpU8HnI9wtxLO/93SUux2dLijylhWb/mcEXh\nOyOx03IPo/Fm9u84+kYlgHUOShgL29G5/m6RJxd/TDQck4zjuxT+yKJlHpA/\ndlSkpSlFZh1Ml131PHutPxUyYLjrnTqYmlU60K72WN2XQu72PlYQZoGw0Znf\nVp4VxzcKn9K2wRRPxqVFOHkeqWeYx2z1NAEUDXqUw96WkWQntqEZr5TSCIuZ\nveWatFc16yiIzI+cGHDKh9dcjYcv+jooIge1VP6GmHzmy+15CyhNjGBjOGdE\nRMFi8y8ctWtqHFv0TcMyimyzU1sxloBJqHoTvckvK6ewtG2+eoAdBeDn50yP\n1UYr8lw4/0UhSbFtdrun4m0CdfKtYWk0lbOdudfj5E1LX8+GAzMu5UKCK1yg\nHe6c\r\n=9fV0\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"apemb","email":"apem.boileau@gmail.com"},"directories":{},"maintainers":[{"name":"apemb","email":"apem.boileau@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/chai-kekka_1.0.0_1609949329394_0.30826242482043353"},"_hasShrinkwrap":false}},"time":{"created":"2021-01-06T14:52:54.137Z","0.0.1":"2021-01-06T14:52:54.245Z","modified":"2021-01-06T16:08:51.855Z","1.0.0":"2021-01-06T16:08:49.591Z"},"maintainers":[{"name":"apemb","email":"apem.boileau@gmail.com"}],"description":"Chai plugin for Kekka","homepage":"https://github.com/apemb/chai-kekka","keywords":["chai","test","chai-plugin","Result","Monad"],"repository":{"type":"git","url":"git+https://github.com/apemb/chai-kekka.git"},"author":{"name":"Antoine Boileau"},"bugs":{"url":"https://github.com/apemb/chai-kekka/issues"},"license":"ISC","readme":"# Chai-Kekka\n\nA Chai plugin for [Kekka](https://github.com/apemb/kekka)\n\n## Installation and Usage\n\nNode: `npm install --save-dev chai-kekka` to get up and running.\n```js\nconst chai = require(\"chai\")\nconst chaiKekka = require(\"chai-kekka\")\n \nchai.use(chaiKekka)\n```\n\n## Documentation\n\n### Test value is a Type Result \nThe `result` property can be used to check that the tested value is an instance of the `Result` class. \n```js\nexpect(Success('Some String')).to.be.a.result\nexpect(Failure(new Error('Failure...'))).to.be.a.result\n```\n\n### Test value is a Result Success\n\nThe `success` property can be used to check that the tested value is an instance of the `Result` class of type `Success`.\n\n```js\n// Positive\nexpect(Success('Success String')).to.be.a.success // OK\nexpect(Failure(new Error('Failure...'))).to.be.a.success // FAIL\nexpect('Not a result').to.be.a.success // FAIL\n\n// Negative\nexpect(Success('Success String')).not.to.be.a.success // FAIL\nexpect(Failure(new Error('Failure...'))).not.to.be.a.success // OK\nexpect('Not a result').not.to.be.a.success // FAIL with 'expected 'Not a result' to be an instance of Result'\n```\n\n\n### Test value is a Result Failure\n\nThe `failure` property can be used to check that the tested value is an instance of the `Result` class of type `Failure`.\n\n```js\n// Positive\nexpect(Success('Success String')).to.be.a.failure // FAIL\nexpect(Failure(new Error('Failure...'))).to.be.a.failure // OK\nexpect('Not a result').to.be.a.failure // FAIL\n\n// Negative\nexpect(Success('Success String')).not.to.be.a.failure // OK\nexpect(Failure(new Error('Failure...'))).not.to.be.a.failure // FAIL\nexpect('Not a result').not.to.be.a.failure // FAIL with 'expected 'Not a result' to be an instance of Result'\n```\n\n### Test associated value of a Result Object\n\nThere are two ways to test the associated value of a Result object:\n - the methods `successWrapping` and `failureWrapping`\n - the property `associatedValue`\n\n#### `successWrapping` and `failureWrapping`\n```js\nconst error = new Error('Failure message')\nexpect(Failure(error)).to.be.a.failureWrapping(error) // OK\nexpect(Failure(error)).to.be.a.successWrapping(error) // FAIL - not a Success\nexpect(Failure(error)).to.be.a.failureWrapping('some other value') // FAIL\n\nexpect(Success('Success String')).to.be.a.successWrapping('Success String') // OK\nexpect(Success('Success String')).to.be.a.failureWrapping('Success String') // Fail - not a Failure\n\n// equality modifiers can be used, such as deep, on successWrapping and failureWrapping\nexpect(Success({ a: '423' })).to.be.a.deep.successWrapping({ a: '423' }) \n```\n\n#### `associatedValue`\n\nThe `associatedValue` property can be used after a `result`, `success` or `failure` property.\nIt changes the target of any assertions that follow in the chain to be on the result associated value.\n\n```js\nexpect(Success('Success String')).to.be.a.success\n .with.associatedValue.that.equals('Success String') // OK\nexpect(Success({ a: '423' })).to.be.a.success\n .with.associatedValue.that.deep.equals({ a: '423' }) // OK - equality modifiers accepted\nexpect(Success({ a: '423' })).to.be.a.failure\n .with.associatedValue.that.deep.equals({ a: '423' }) // FAIL - not a failure\nexpect(Success({ a: '423' })).to.be.a.result\n .with.associatedValue.that.deep.equals({ a: '423' }) // OK\nexpect(Success('Success String')).to.have.associatedValue.that.equals('Success String') // FAILS \n// associatedValue must be after either a result, success or failure assertion property\n```\n\n","readmeFilename":"README.md"}

plugins/chai_kekka.md

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
---
2+
layout: plugin
3+
permalink: plugins/chai-kekka/
4+
pluginName: chai-kekka
5+
---
6+
7+
# Chai-Kekka
8+
9+
A Chai plugin for [Kekka](https://github.com/apemb/kekka)
10+
11+
## Installation and Usage
12+
13+
Node: `npm install --save-dev chai-kekka` to get up and running.
14+
```js
15+
const chai = require("chai")
16+
const chaiKekka = require("chai-kekka")
17+
18+
chai.use(chaiKekka)
19+
```
20+
21+
## Documentation
22+
23+
### Test value is a Type Result
24+
The `result` property can be used to check that the tested value is an instance of the `Result` class.
25+
```js
26+
expect(Success('Some String')).to.be.a.result
27+
expect(Failure(new Error('Failure...'))).to.be.a.result
28+
```
29+
30+
### Test value is a Result Success
31+
32+
The `success` property can be used to check that the tested value is an instance of the `Result` class of type `Success`.
33+
34+
```js
35+
// Positive
36+
expect(Success('Success String')).to.be.a.success // OK
37+
expect(Failure(new Error('Failure...'))).to.be.a.success // FAIL
38+
expect('Not a result').to.be.a.success // FAIL
39+
40+
// Negative
41+
expect(Success('Success String')).not.to.be.a.success // FAIL
42+
expect(Failure(new Error('Failure...'))).not.to.be.a.success // OK
43+
expect('Not a result').not.to.be.a.success // FAIL with 'expected 'Not a result' to be an instance of Result'
44+
```
45+
46+
47+
### Test value is a Result Failure
48+
49+
The `failure` property can be used to check that the tested value is an instance of the `Result` class of type `Failure`.
50+
51+
```js
52+
// Positive
53+
expect(Success('Success String')).to.be.a.failure // FAIL
54+
expect(Failure(new Error('Failure...'))).to.be.a.failure // OK
55+
expect('Not a result').to.be.a.failure // FAIL
56+
57+
// Negative
58+
expect(Success('Success String')).not.to.be.a.failure // OK
59+
expect(Failure(new Error('Failure...'))).not.to.be.a.failure // FAIL
60+
expect('Not a result').not.to.be.a.failure // FAIL with 'expected 'Not a result' to be an instance of Result'
61+
```
62+
63+
### Test associated value of a Result Object
64+
65+
There are two ways to test the associated value of a Result object:
66+
- the methods `successWrapping` and `failureWrapping`
67+
- the property `associatedValue`
68+
69+
#### `successWrapping` and `failureWrapping`
70+
```js
71+
const error = new Error('Failure message')
72+
expect(Failure(error)).to.be.a.failureWrapping(error) // OK
73+
expect(Failure(error)).to.be.a.successWrapping(error) // FAIL - not a Success
74+
expect(Failure(error)).to.be.a.failureWrapping('some other value') // FAIL
75+
76+
expect(Success('Success String')).to.be.a.successWrapping('Success String') // OK
77+
expect(Success('Success String')).to.be.a.failureWrapping('Success String') // Fail - not a Failure
78+
79+
// equality modifiers can be used, such as deep, on successWrapping and failureWrapping
80+
expect(Success({ a: '423' })).to.be.a.deep.successWrapping({ a: '423' })
81+
```
82+
83+
#### `associatedValue`
84+
85+
The `associatedValue` property can be used after a `result`, `success` or `failure` property.
86+
It changes the target of any assertions that follow in the chain to be on the result associated value.
87+
88+
```js
89+
expect(Success('Success String')).to.be.a.success
90+
.with.associatedValue.that.equals('Success String') // OK
91+
expect(Success({ a: '423' })).to.be.a.success
92+
.with.associatedValue.that.deep.equals({ a: '423' }) // OK - equality modifiers accepted
93+
expect(Success({ a: '423' })).to.be.a.failure
94+
.with.associatedValue.that.deep.equals({ a: '423' }) // FAIL - not a failure
95+
expect(Success({ a: '423' })).to.be.a.result
96+
.with.associatedValue.that.deep.equals({ a: '423' }) // OK
97+
expect(Success('Success String')).to.have.associatedValue.that.equals('Success String') // FAILS
98+
// associatedValue must be after either a result, success or failure assertion property
99+
```
100+

0 commit comments

Comments
 (0)