Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('should create an observable JSON object', () => {
const item = new ObservableJSON();
expect(item).to.be.an.instanceof(ObservableJSON);
});
it('should return a copy of the data', () => {
const item = new ObservableJSON();
item.set('foo', { bar: 1 });
const value = item.toJSON();
value['bar'] = 2;
expect((item.get('foo') as any)['bar']).to.equal(1);
});
});
it('should serialize the model to JSON', () => {
const item = new ObservableJSON();
item.set('foo', 1);
expect(item.toJSON()['foo']).to.equal(1);
});