Skip to content

Commit

Permalink
Add test for array__filter
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrei Dumitrescu committed Oct 27, 2018
1 parent 40dd6d9 commit 0ce462e
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 5 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

<!-- /MarkdownTOC -->

Expand Down Expand Up @@ -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)
2 changes: 1 addition & 1 deletion src/array__filter/filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
Expand Down
12 changes: 12 additions & 0 deletions src/array__filter/filter.test.js
Original file line number Diff line number Diff line change
@@ -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()
})

0 comments on commit 0ce462e

Please sign in to comment.