Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
Is it possible to use assert.equal method in Node.js like this:
assert.equal(some_var, 12 OR 34);
If some_var is 12 or 34 I need the test to have passed.
you can do like this
expect([12, 34]).to.include(some_var);
i usually use chai to do unit test, but the concept should be the same.
Add a comment
assert([12, 34].includes(some_var));
It actually ends up 2 characters less than the chai solution
Required, but never shown
By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.
Start asking to get answers
Find the answer to your question by asking.
Explore related questions
See similar questions with these tags.