Skip to content

enhancement request: extend the "hasProperty" idea to arbitrary functions #39

@richardwan

Description

@richardwan

the "hasProperty" matcher lets you convert from __.assertThat('hello'.length, __.greaterThan(3)) to assertThat('hello', hasProperty('length', __.greaterThan(3))

can we extend this idea to arbitrary functions?
so instead of writing __.assertThat(element.querySelector('option').value.length, __.greaterThan(3))
one could write __assertThat(element, evaluates(x => x.querySelector('option').value.length, __.greaterThan(3)))

if there is interest in this enhancement i would be happy to implement it. (I dont like the name "evaluates" and would happily pick a better name as soon as anyone has an alternate suggestions)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions