Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

integrationtest typescript

it(`GIVEN an id = "${id}", WHEN getDetailedVehicle() is executed, THEN the Promise will be resolved with ${expectedVehicleDto}.`, async () => {
            (VehicleRepository.findOne as SinonStub).withArgs(id).resolves(vehicleEntity);
            (ClassTransformer.plainToClass as SinonStub).withArgs(VehicleDto, vehicleEntity).returns(vehicleDto);
            (DamageService.getDamageState as SinonStub).withArgs(vehicleDto.id).resolves(true);
 
            const result = VehicleService.getDetailedVehicle(id);
 
            await expect(result).to.be.eventually.deep.equal(expectedVehicleDto);
});
Source by www.novatec-gmbh.de #
 
PREVIOUS NEXT
Tagged: #integrationtest #typescript
ADD COMMENT
Topic
Name
7+9 =