I am creating a test module that has only BatteryService as a provider. I have an ElasticService which has nothing to do with BatteryService, but for some reason I get the error: "ConfigurationError: Missing node(s) option" which refers to the ElasticsearchService class. Is there any solution to this problem?
battery.service.ts
@Injectable()
export class BatteryService {
constructor(
@Inject(WINSTON_MODULE_NEST_PROVIDER) private readonly logger: Logger,
@InjectModel(Device.name) private deviceModel: Model<DeviceSchemaDocument>,
) {}
async addBatteryDevice(batteryInput: BatteryInput) {
try {
const device = new this.deviceModel({
...batteryInput,
});
return await device.save();
} catch (e) {
this.logger.error(e);
}
}
async updateBatteryDevice(id: string, input: BatteryUpdateInput) {
try {
return await this.deviceModel.findByIdAndUpdate(id, input, {
new: true,
useFindAndModify: false,
});
} catch (e) {
this.logger.error(e);
}
}
}