Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Messages iobackends ultimo #149

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open

Conversation

pardo-bsso
Copy link
Member

This also depends on inaes-tic/mbc-common#62
Previous discussion at #145

For some tests we do a require of mosto.js, that in turn ends up
calling iobackend.patchBackbone().

This wouldn't be a problem if it happens at the beginning but within the
test suite models were created before and after that and it is not a
very good thing (for instance, Backbone-relational crashes with a
'RangeError: Maximum call stack size exceeded').

So, we patch backbone before all tests are run and also move the
require() statements inside the functions. That way they will be
evaluated only when they are run and not when the whole test suite
is built.
_ = require('underscore')
;

module.exports = function (db, test_db) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would use

function (db, test)

And if test is true, set the backends for test using db. Cant think of a case where db and testdb would be different dbs...

@jmrunge
Copy link
Member

jmrunge commented Apr 15, 2014

Can we have a test for this? Mosto is quite tested and it would be nice to keep it this way. Also, Travis is failing, could you check why?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants