Chai.js: Object contains/includes

Hei, just published chai-subset. Check this out: https://www.npmjs.org/package/chai-subset This should work for you)

 var chai = require('chai');
 var chaiSubset = require('chai-subset');
 chai.use(chaiSubset);

 var obj = {
     a: 'b',
     c: 'd',
     e: {
         foo: 'bar',
         baz: {
             qux: 'quux'
         }
     }
 };

 expect(obj).to.containSubset({
     e: {
         foo: 'bar',
         baz: {
             qux: 'quux'
         }
     }
 });

The include and contain assertions can be used as either property based language chains or as methods to assert the inclusion of an object in an array or a substring in a string. When used as language chains, they toggle the contain flag for the keys assertion. [emphasis mine]

So if you're invoking include on an object (not an array or a string), then it only serves to toggle the contain flag for the keys assertion. By the looks of your example, testing for deep equality would make more sense, possibly checking for the key first.

origins.should.include.keys("otherObj");
origins.otherObj.should.deep.equal(match.otherObj);

Actually, now I browse the other examples, you would probably be happiest with this :

origins.should.have.deep.property("otherObj", match.otherObj)