问题
Is there any way to assert that string
is one of array
elements with chai bdd? I couldn't find that in Chai API
expect("bar").to.be.one.of(["bar", "key"]);
回答1:
Flip the check around:
expect(["bar", "key"]).to.include("bar");
来源:https://stackoverflow.com/questions/32662162/chai-expect-to-be-one-of-array-elements