All Downloads are FREE. Search and download functionalities are using the official Maven repository.

generator.client.vue.test.unit.http.AxiosHttpStub.ts.mustache Maven / Gradle / Ivy

There is a newer version: 1.22.0
Show newest version
import sinon, { type SinonStub } from 'sinon';
import { AxiosHttp, type AxiosHttpResponse } from '@/http/AxiosHttp';

export interface AxiosHttpStub extends AxiosHttp {
  get: SinonStub;
  post: SinonStub;
  delete: SinonStub;
  put: SinonStub;
}

export const stubAxiosHttp = (): AxiosHttpStub =>
  ({
    get: sinon.stub(),
    post: sinon.stub(),
    delete: sinon.stub(),
    put: sinon.stub(),
  }) as AxiosHttpStub;

export const dataBackendResponse = (data: T): AxiosHttpResponse =>
  ({
    data,
  }) as AxiosHttpResponse;




© 2015 - 2024 Weber Informatics LLC | Privacy Policy