Skip to content

Instantly share code, notes, and snippets.

@sergueyarellano
Created May 26, 2021 14:22
Show Gist options
  • Save sergueyarellano/2b3baab101863b428ee202df3de6cf1d to your computer and use it in GitHub Desktop.
Save sergueyarellano/2b3baab101863b428ee202df3de6cf1d to your computer and use it in GitHub Desktop.
test('substituteOperators() should map operator property with the correct method', function ({ deepEqual, end }) {
const restrictions = [{ property: 'distance', operator: 'less than', value: '200' }]
const restriction = substituteOperators(restrictions)[0]
{
const actual = restriction.operator(1, 2) // Start with one assertion
const expected = true
deepEqual(actual, expected)
}
{
const actual = restriction.operator(2, 2) // keep making assertions
const expected = false
deepEqual(actual, expected)
}
{
const actual = restriction.operator(3, 2) // keep making assertions
const expected = false
deepEqual(actual, expected)
}
end()
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment