You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
varassert=require('chai').assert,destroyCollections=require('../../../helper').destroyCollections;describe('C',function(){varidOfC;before(function(done){B.create({id: DateTimeService.generateNowDate()}).then(function(newB){A.create({name: "my new a"}).then(function(newA){C.create({a_id: newA.id,b_id: newB.id,quantity: 12}).then(function(newC){idOfC=newC.id;done();}).catch(done);}).catch(done);}).catch(done);});after(function(done){destroyCollections(A,B,C,done);});it('findOne()',function(done){C.findOne(idOfC).then(function(result){sails.log.info("Result of find one is",result);assert.equal(result.quantity,12,"quantity decremented");done();}).catch(done);});});
The error is:
RangeError: Maximum call stack size exceeded at Object.defineProperty.value (E:\tmp\assosiation\node_modules\waterline\lib\waterline\model\lib\model.js:67:20) at formatValue (util.js:215:21)...//repeated billion times... at formatValue (util.js:217:13) at Object.inspect (util.js:107:10) at E:\tmp\assosiation\node_modules\captains-log\lib\write.js:65:22 at Function.forEach (E:\tmp\assosiation\node_modules\captains-log\node_modules\lodash\dist\lodash.js:3297:15) at Function._writeLogToConsole [as info] (E:\tmp\assosiation\node_modules\captains-log\lib\write.js:55:5) at E:\tmp\assosiation\test\unit\test\models\C.test.js:25:14 at tryCatcher (E:\tmp\assosiation\node_modules\waterline\node_modules\bluebird\js\main\util.js:26:23) at Promise._settlePromiseFromHandler (E:\tmp\assosiation\node_modules\waterline\node_modules\bluebird\js\main\promise.js:503:31) at Promise._settlePromiseAt (E:\tmp\assosiation\node_modules\waterline\node_modules\bluebird\js\main\promise.js:577:18) at Promise._settlePromises (E:\tmp\assosiation\node_modules\waterline\node_modules\bluebird\js\main\promise.js:693:14) at Async._drainQueue (E:\tmp\assosiation\node_modules\waterline\node_modules\bluebird\js\main\async.js:123:16) at Async._drainQueues (E:\tmp\assosiation\node_modules\waterline\node_modules\bluebird\js\main\async.js:133:10) at Immediate.Async.drainQueues [as _onImmediate] (E:\tmp\assosiation\node_modules\waterline\node_modules\bluebird\js\main\async.js:15:14) at processImmediate [as _immediateCallback] (timers.js:383:17)
Given:
model A:
model B:
model C:
test:
The error is:
Here is the repository/branch to run the test: https://github.com/elennaro/assosiation-waterline/tree/error-find-one-assosiation
The text was updated successfully, but these errors were encountered: