to satisfy

  • <wrapperObject> to [exhaustively] satisfy <wrapperObject>
  • <wrapperObject> to [exhaustively] satisfy <any>

As the types for knockout observables and computeds both inherit from wrapperObject they support to satisfy on the content of the observables:

expect(ko.observable({
    id: '4331241234',
    name: ko.observable('test'),
    age: ko.observable(42)
}), 'to satisfy', {
    id: '4331241234',
    name: 'test',
    age: 42
});

In case of a failing expectation you get the following output:

expect(ko.observable({
    id: '4331241234',
    name: ko.observable('test'),
    age: ko.observable(42),
}), 'to satisfy', {
    id: '4331241234',
    name: 'hest',
    age: 41
});
expected ko.observable({ id'4331241234'name: ko.observable('test'), age: ko.observable(42) })
to satisfy { id'4331241234'name'hest'age41 }
 
ko.observable({
  
id'4331241234',
  
name
ko.observable('test'), 
//
//
//
//
 
should equal 
'hest'
 
test
hest
  
age: ko.observable(42
//
 
should equal 
41
})