You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 31, 2024. It is now read-only.
Malabi should provide extensive and easy-to-use assertion utilities.
An issue that came up while designing the API was the fact that each test is going to assert against an array of spans.
This causes uncertainty on which span the assertion will be performed.
Here are some possible ideas that came up:
1. Reduce, then Assert
In this approach, malabi will provide a different function for extracting a single span that meets the filters, and another function for assertion.
This approach may give the most precise assertion, but is a bit confusing for the end-user, and the decision on which operator will be part of extract and which will be part of assert is a bit aribtraty.
Another possibility for this option is that getSpans will return a span array already wrapped in extraction utils, obviating the need to use the extract function:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Malabi should provide extensive and easy-to-use assertion utilities.
An issue that came up while designing the API was the fact that each test is going to assert against an array of spans.
This causes uncertainty on which span the assertion will be performed.
Here are some possible ideas that came up:
1. Reduce, then Assert
In this approach, malabi will provide a different function for extracting a single span that meets the filters, and another function for assertion.
This approach may give the most precise assertion, but is a bit confusing for the end-user, and the decision on which operator will be part of
extract
and which will be part ofassert
is a bit aribtraty.Another possibility for this option is that
getSpans
will return a span array already wrapped in extraction utils, obviating the need to use theextract
function:2. Reduce and assert in a single statement
A bit like 1, but in a single statement:
3. Assert existence
I think this option has the easiest learning curve but lacks precision in cases where we have 2 spans that are very similar.
Style 1 - use
where
Style 2 - conditions object
jasmine style option
replace
toHaveMongo
with jasmine style, ie:expect(spans).to.have.mongo
, orexpect(spans).to.not.have.mongo
Beta Was this translation helpful? Give feedback.
All reactions