Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
beforeEach(() => {
reset(citiesServiceMock);
const citiesServiceMockInstance: CitiesService = instance(citiesServiceMock);
controller = new CitiesController(citiesServiceMockInstance);
testData = {
city: {
country: chance.country(),
id: chance.natural(),
name: chance.city(),
populationDensity: chance.natural()
},
error: {
code: chance.word(),
description: chance.sentence()
}
};
});
beforeEach(() => {
reset(swaggerServiceMock);
const citiesServiceMockInstance: SwaggerService = instance(swaggerServiceMock);
controller = new SwaggerController(citiesServiceMockInstance);
testData = {
error: {
code: chance.word(),
description: chance.sentence()
},
swaggerDoc: {
info: {
title: chance.sentence(),
version: chance.word(),
},
paths: {
}
}
};
beforeEach(() => {
reset(citiesRepositoryMock);
service = new CitiesService(citiesRepositoryMockInstance, process.env);
testCity = {
country: chance.country(),
id: chance.natural(),
name: chance.city(),
populationDensity: chance.natural()
};
});