Schema hasn't been registered for model “categories”. Use mongoose.model(name, schema)
问题 When i called my function in controller through postman,it worked fine and i got results but when i wrote a test case for the same function it is saying the error as MissingSchemaError: Schema hasn't been registered for model "categories". Use mongoose.model(name, schema) I was completely confused about these because how come a function that is working well go wrong with test case.Can any one suggest help please. My test.js, var server = require('../modules/categories/model/categories.server