From 0ce462ea7589d540dc14c1ca07a1c2f75b2c29ba Mon Sep 17 00:00:00 2001 From: Andrei Dumitrescu Date: Sat, 27 Oct 2018 14:24:11 +0200 Subject: [PATCH] Add test for `array__filter` --- CHANGELOG.md | 9 ++++++++- README.md | 6 +++--- src/array__filter/filter.js | 2 +- src/array__filter/filter.test.js | 12 ++++++++++++ 4 files changed, 24 insertions(+), 5 deletions(-) create mode 100644 src/array__filter/filter.test.js diff --git a/CHANGELOG.md b/CHANGELOG.md index 2980163..e7cdfa0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +## [0.10.1] - 27 October 2018 + +### Add + +- Add test for [`array__filter`](/src/array__filter/filter.js) + ## [0.10.0] - 27 October 2018 ### Add @@ -60,8 +66,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Removed `flow` support -[Unreleased]: https://github.com/codemachiner/m/compare/v0.10.0...HEAD +[Unreleased]: https://github.com/codemachiner/m/compare/v0.10.1...HEAD +[0.10.1]: https://github.com/codemachiner/m/compare/v0.10.0...v0.10.1 [0.10.0]: https://github.com/codemachiner/m/compare/v0.9.0...v0.10.0 [0.9.0]: https://github.com/codemachiner/m/compare/v0.8.1...v0.9.0 [0.8.1]: https://github.com/codemachiner/m/compare/v0.8.0...v0.8.1 diff --git a/README.md b/README.md index 2a6575d..1a1ffbb 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Use [Ramda](https://github.com/ramda/ramda) to be safe. - [Install](#install) - [Develop](#develop) - [Changelog](#changelog) - - [0.10.0 - 27 October 2018](#0100---27-october-2018) + - [0.10.1 - 27 October 2018](#0101---27-october-2018) @@ -97,8 +97,8 @@ Use `npm test` to run tests (any `*.test.js`) once or `npm run tdd` to watch `sr History of all changes in [CHANGELOG.md](CHANGELOG.md) -### 0.10.0 - 27 October 2018 +### 0.10.1 - 27 October 2018 #### Add -- Add test coverage and [coveralls](https://coveralls.io/github/codemachiner/m) badge +- Add test for [`array__filter`](/src/array__filter/filter.js) diff --git a/src/array__filter/filter.js b/src/array__filter/filter.js index 929e01e..156a1d5 100644 --- a/src/array__filter/filter.js +++ b/src/array__filter/filter.js @@ -6,7 +6,7 @@ * @return {Array} * * @tag Array - * @signature ( fn: Function ) => ( source: Array): Array + * @signature (fn: Function) => (source: Array): Array */ module.exports = fn => source => { const filteredArray = [] diff --git a/src/array__filter/filter.test.js b/src/array__filter/filter.test.js new file mode 100644 index 0000000..d8640d5 --- /dev/null +++ b/src/array__filter/filter.test.js @@ -0,0 +1,12 @@ +const test = require("tape") +const filter = require("./filter") + +test("array::filter", t => { + t.deepEqual( + filter(filterElm => filterElm <= 3)([1, 2, 3, 4, 5, 6]), + [1, 2, 3], + "Keep items lower or equal than 3" + ) + + t.end() +})