Created
May 28, 2021 18:31
-
-
Save sergueyarellano/42d35b9d9de66b727951cfbbced465bc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { result } = await pipe( | |
composeRequest, | |
makeRequest, | |
mapResponse, | |
setWith('data.mappedResponse', applyFilters(config.filters)), | |
createResult | |
)(lift(config)) | |
test('applyFilters() should apply filters to every element in the array passed', async function ({ deepEqual, end }) { | |
const filters = [(element) => element.x < 4] | |
const data = [ | |
{ x: 1, y: 2 }, | |
{ x: 3, y: 4 }, | |
{ x: 5, y: 6 } | |
] | |
const actual = applyFilters(filters)(deepFreeze(data)) | |
const expected = [ | |
{ x: 1, y: 2 }, | |
{ x: 3, y: 4 } | |
] | |
deepEqual(actual, expected) | |
end() | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment