You can check my Colonie repo. The pvp-shield module have the in memory db, collection deletion between it and the way to get the model from the testing module. github.com/bassochette/colonies/tr...
Thanks a lot, I managed to do it! For others who might struggle: I wasn't aware of the convention for the model name to use in module.get(). It's the name property that gets passed into MongooseModule.forFeature() + the suffix 'Model' (SquidModel in this example). Apologies if this obvious, but this string is never explicitly defined as a constant or class name etc.
Oh, that's really not obvious...
I found this trick by mimicking the underlying metod of InjectModel from the nest/mongoose repo. github.com/nestjs/mongoose/blob/28...
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
You can check my Colonie repo. The pvp-shield module have the in memory db, collection deletion between
it
and the way to get the model from the testing module.github.com/bassochette/colonies/tr...
Thanks a lot, I managed to do it! For others who might struggle: I wasn't aware of the convention for the model name to use in
module.get()
. It's the name property that gets passed intoMongooseModule.forFeature()
+ the suffix 'Model' (SquidModel
in this example). Apologies if this obvious, but this string is never explicitly defined as a constant or class name etc.Oh, that's really not obvious...
I found this trick by mimicking the underlying metod of
InjectModel
from the nest/mongoose repo.github.com/nestjs/mongoose/blob/28...