本文整理汇总了TypeScript中fetch-mock.restore函数的典型用法代码示例。如果您正苦于以下问题:TypeScript restore函数的具体用法?TypeScript restore怎么用?TypeScript restore使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了restore函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: afterEach
afterEach(() => {
fetchMock.restore();
});
示例2:
.then(() => { FetchMock.restore(); t.end() })
示例3: afterEach
afterEach(function () {
fetchMock.restore();
});
示例4:
fetchMock.mock(() => true, 200);
fetchMock.mock((url, opts) => true, 200);
fetchMock.once("http://test.com", 200);
fetchMock.mock(/test/, "test").mock(/test/, { a: "b" });
fetchMock.mock(/test/, {
status: 200,
headers: {
test: "test"
},
body: {
a: "b"
}
});
fetchMock.restore().reset();
(fetchMock.calls().matched[0][1] as RequestInit).body;
fetchMock.calls().unmatched[0][0].toUpperCase();
fetchMock.calls("http://test.com")[0][0].toUpperCase();
(fetchMock.calls("http://test.com")[0][1] as RequestInit).body;
const doneStatus: boolean = fetchMock.done();
const doneStatusArguments: boolean = fetchMock.done("http://test.com");
const calledStatus: boolean = fetchMock.called();
const calledStatusArguments = fetchMock.called("http://test.com");
(fetchMock.lastCall()[1] as RequestInit).body;
const lastUrl: string = fetchMock.lastUrl();
fetchMock.lastOptions();
示例5: beforeEach
beforeEach(() => {
expect.hasAssertions();
fetchMock.restore();
});
示例6: beforeEach
beforeEach(() => {
fetchMock.restore();
fetchMock.post('begin:http://data/', makePromise(data));
fetchMock.get('begin:http://data/', makePromise(data));
});
示例7: beforeEach
beforeEach(() => {
mock.restore();
});
示例8: afterEach
afterEach(() => {
fetchMock.restore();
resetInterceptors();
});
示例9: beforeEach
beforeEach(() => {
fetchMock.restore();
fetchMock.post('/graphql', makePromise(data));
});