Writing a test to check if object returns null or string

Try to.be.oneOf

Chai Assertion Library - oneof method

Testing for null or “string” isn’t straight forward.

However, its been discussed on the forum before.

const response = pm.response.json();

pm.test("model_image = string or null", () => {
    let model_image = response.model_image;
    pm.expect(Object.prototype.toString.call(model_image)).to.be.oneOf(["[object String]","[object Null]"])
});