Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function () {
var info = Montage.getInfoForObject(objects.Proto);
expect(info.objectName).toBe("Proto");
expect(info.isInstance).toBeFalsy();
expect(info.moduleId).toBe("spec/core/testobjects");
});
it("should describe a subclass object",
deserializer.deserializeObject().then(function (root) {
var info = Montage.getInfoForObject(root);
expect(Object.getPrototypeOf(root)).toBe(objects.TestobjectsV2.prototype);
expect(info.moduleId).toBe("spec/serialization/testobjects-v2");
expect(info.objectName).toBe("TestobjectsV2");
expect(info.isInstance).toBe(true);
expect(root.instance).toBeUndefined();
}).catch(function(reason) {
fail(reason);
deserializer.deserializeObject().then(function (root) {
var info = Montage.getInfoForObject(root);
expect(Object.getPrototypeOf(root)).toBe(objects.TestobjectsV2.prototype);
expect(info.moduleId).toBe("spec/serialization/testobjects-v2");
expect(info.objectName).toBe("TestobjectsV2");
expect(info.isInstance).toBe(true);
expect(root.instance).toBeUndefined();
}).catch(function(reason) {
fail(reason);
deserializer.deserializeObject().then(function (root) {
var info = Montage.getInfoForObject(root);
expect(info.moduleId).toBe("core/core");
expect(info.isInstance).toBe(true);
expect(root.type).toBeUndefined();
expect(root.name).toBe("RootObjectDescriptor");
expect(root.number).toBe(42);
expect(root.string).toBe("a string");
}).catch(function (reason) {
fail(reason);
deserializer.deserializeObject().then(function (root) {
var info = Montage.getInfoForObject(root);
expect(info.moduleId).toBe("spec/serialization/testmjson.mjson");
expect(info.isInstance).toBe(true);
expect(root.type).toBeUndefined();
expect(root.name).toBe("RootObjectDescriptor");
expect(root.number).toBe(42);
expect(root.string).toBe("a string");
}).catch(function (reason) {
fail(reason);