本文整理汇总了TypeScript中typescript-fetch-api.PetApiFactory函数的典型用法代码示例。如果您正苦于以下问题:TypeScript PetApiFactory函数的具体用法?TypeScript PetApiFactory怎么用?TypeScript PetApiFactory使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PetApiFactory函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it('should not contain deleted Pet', () => {
return PetApiFactory().getPetById({ petId: fixture.id }, requestOptions).then((result) => {
return expect(result).to.not.exist;
}, (err) => {
return expect(err).to.exist;
});
});
示例2: PetApiFactory
return PetApiFactory().getPetById({ petId: fixture.id }, requestOptions).then( (result) => {
result.name = 'newname';
return PetApiFactory().updatePet({ body: result }, requestOptions).then(() => {
return PetApiFactory().getPetById({ petId: fixture.id }, requestOptions).then( (result) => {
return expect(result.name).to.deep.equal('newname');
});
});
});
示例3: it
it('should update Pet by ID', () => {
return PetApiFactory().getPetById({ petId: fixture.id }).then( (result) => {
result.name = 'newname';
return PetApiFactory().updatePet({ body: result }).then(() => {
return PetApiFactory().getPetById({ petId: fixture.id }).then( (result) => {
return expect(result.name).to.deep.equal('newname');
});
});
});
});