cleaner
cleaner copied to clipboard
MongoInternals is not defined
I am trying to use this package in a package test that uses practicalmeteor:mocha as the test runner. My test is server side only when I am getting the following error:
Error: MongoInternals is not defined
at resetDatabase (packages/xolvio_cleaner/packages/xolvio_cleaner.js:22:1)
at Hook.<anonymous> (packages/local-test:tdb:organizations/tests/methods.js:8:7)
at run (packages/practicalmeteor:mocha-core/server.js:56:16)
This is my Package.onTest:
Package.onTest(function(api) {
api.use([
'ecmascript',
'mongo',
'practicalmeteor:mocha',
'xolvio:cleaner',
'practicalmeteor:chai',
'tdb:organizations'
]);
api.addFiles([
'tests/index.js',
'tests/methods.js'
]);
});
What could be wrong?
UPDATE - 5 minutes later I could make my test work by not using this package with the following approach:
if (Meteor.isServer) {
Meteor.methods({
'test.cleanOrganizations': () => Organizations.remove({})
});
describe('tdb:organizations - methods', () => {
beforeEach( done => {
Meteor.call('test.cleanOrganizations', done);
});
...
So I think the problem is not related with the mongo dependency because my collection is using it.
Keep the same problems... No help?