webcompere / model-assert

Assertions for data models
MIT License
28 stars 3 forks source link

Ignore If #39

Open ashleyfrieze opened 3 years ago

ashleyfrieze commented 3 years ago

Summary

Explain in a couple of sentences the problem/goal you have.

Json Examples

Simplest Input JSON

Provide the simplest JSON that can illustrate the problem/goal

{"name":"foo"}

Simplest comparison

Compare with

{"name":null}

Expected green or red test

Show the simplest test code that you think should pass or fail for this to work.

assert(actual)
  .where()
    .path(ANY_SUBTREE).ignoreIfExpected().isNull()
  .isEqualTo(expected);