Creating Test for new elements fails with mismatch Due to Base

Hi,

I am trying to create new elements and tests for them on BPMN-MODDLE.

Here is the XML of the message element:

`var {rootElement} = fromFile(‘test/fixtures0/xml/new-message.part.bpmn’, ‘bpmn:Message’);
var expected = {
$type: ‘bpmn:Message’,
id: ‘order’,
name: ‘Order’,
payload: ‘{order}’
};
expect(rootElement).to.jsonEqual(expected);

`

The rootElement is:

 Base {
  '$type': 'bpmn:ScriptTask',
  id: 'script',
  name: 'Script Task',
  scriptRef: 'script-id',
  scriptVersion: '10',
  config: '{}' }

If you notice, there is an extra Base in front of JSON, therefore it is not matching with expected.
Any clues please.

It seems like the objects you are trying to compare are completely different (their names, ids and stuff). It is a JS feature that when you print an object out with NodeJS, you see the type as well on the console. So there’s no “extra Base in front of JSON”.

I found a way by JSON.parse(JSON.stringify(obj))
Thanks a lot for helping