chai-quantifiers
Advanced tools
Comparing version 1.0.0-alpha.2 to 1.0.0-alpha.3
{ | ||
"name": "chai-quantifiers", | ||
"version": "1.0.0-alpha.2", | ||
"description": "Array quantifier assertions for chai", | ||
"version": "1.0.0-alpha.3", | ||
"description": "Array quantifier assertions for chai assertion library", | ||
"main": "src/chai-quantifiers.js", | ||
@@ -12,5 +12,6 @@ "repository": { | ||
"chai", | ||
"assertion", | ||
"assertions", | ||
"chai-plugin", | ||
"quantifiers" | ||
"quantifiers", | ||
"array" | ||
], | ||
@@ -35,3 +36,2 @@ "author": "Frank Thelen>", | ||
"chai": "^4.1.2", | ||
"chai-as-promised": "^7.1.1", | ||
"coveralls": "^3.0.0", | ||
@@ -38,0 +38,0 @@ "eslint": "^4.18.0", |
# chai-quantifiers | ||
Array quantifier assertions for [Chai](https://www.npmjs.com/package/chai). | ||
Array quantifier assertions for [Chai](http://chaijs.com/) assertion library. | ||
@@ -27,3 +27,3 @@ [![Build Status](https://travis-ci.org/frankthelen/chai-quantifiers.svg?branch=master)](https://travis-ci.org/frankthelen/chai-quantifiers) | ||
A few examples: | ||
A quick example: | ||
```javascript | ||
@@ -35,2 +35,4 @@ const chai = require('chai'); | ||
const { expect } = chai; | ||
describe('chai-quantifiers', () => { | ||
@@ -37,0 +39,0 @@ it('containAll should be true if all items are true', () => { |
const evaluate = (array, predicate) => | ||
array.reduce( | ||
(acc, item, i) => | ||
(predicate(item) ? ({ t: [...acc.t, i], f: acc.f }) : ({ t: acc.t, f: [...acc.f, i] })), | ||
(predicate(item) ? { t: [...acc.t, i], f: acc.f } : { t: acc.t, f: [...acc.f, i] }), | ||
{ t: [], f: [] } | ||
@@ -6,0 +6,0 @@ ); |
const chai = require('chai'); | ||
const chaiAsPromised = require('chai-as-promised'); | ||
const chaiQuantifiers = require('..'); | ||
chai.use(chaiAsPromised); | ||
chai.use(chaiQuantifiers); | ||
@@ -7,0 +5,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9
48
7234
72