Example #1
0
 it('should deserialize the model from JSON', () => {
   let model = new DocumentModel();
   let data = null;
   model.fromJSON(data);
   expect(model.toString()).to.be('null');
 });
Example #2
0
 it('should serialize the model to JSON', () => {
   let model = new DocumentModel();
   let data = { 'foo': 1 };
   model.fromJSON(data);
   expect(model.toJSON()).to.eql(data);
 });
Example #3
0
 it('should serialize the model to JSON', () => {
   const model = new DocumentModel();
   const data = { foo: 1 };
   model.fromJSON(data);
   expect(model.toJSON()).to.deep.equal(data);
 });
Example #4
0
 it('should deserialize the model from JSON', () => {
   const model = new DocumentModel();
   const data: null = null;
   model.fromJSON(data);
   expect(model.toString()).to.equal('null');
 });
 it('should deserialize the model from JSON', () => {
   let model = new DocumentModel();
   model.fromJSON('"foo"');
   expect(model.toString()).to.be('foo');
 });