Closed mrmarcsmith closed 5 years ago
I've used and contributed to some 'fake mongos' for unit testing, but I've since switched over to using mongodb-runner instead as it is fast and easy.
the unit testing setup for parse-server is pretty messy, but if you look at how it is setup for the integration Parse-SDK-JS, it's pretty straight forward: https://github.com/parse-community/Parse-SDK-JS/tree/master/integration
is that helpful?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is.
I'm bummed there isn't a "baked in" method for efficient unit testing without mongo.
Describe the solution you'd like A clear and concise description of what you want to happen.
I'm imagining an "In-Memory" storage adapter that contains ALL of the functionality of parse without any of the unit-testing "baggage" of mongo. For example, I could "save" an object, then query for the object but the "object" is stored in RAM instead of Mongo.
Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.
Our current options for testing are:
module.exports = { job_1: function() {}, job_2: function() {} } ...
// main.js
var jobs = require('lib/jobs'); Object.keys(jobs).forEach(function(jobName) { Parse.Cloud.job(jobName, jobs[jobName]); });