UNPKG

water-orm

Version:

A monolith version of Standalone waterline ORM

42 lines (32 loc) 1 kB
var Waterline = require('../../../../lib/waterline'), assert = require('assert'); describe('Core Schema', function() { describe('with instance methods', function() { var person; before(function(done) { var waterline = new Waterline(); var Person = Waterline.Collection.extend({ identity: 'person', connection: 'foo', attributes: { first_name: 'string', doSomething: function() {} } }); waterline.loadCollection(Person); var connections = { 'foo': { adapter: 'foobar' } }; waterline.initialize({ adapters: { foobar: {} }, connections: connections }, function(err, colls) { if(err) return done(err); person = colls.collections.person; done(); }); }); it('should ignore instance methods in the schema', function() { assert(!person._schema.schema.doSomething); }); }); });